<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<title>Source code</title>
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
</head>
<body>
<div class="sourceContainer">
<pre><span class="sourceLineNo">001</span>/* ===========================================================<a name="line.1"></a>
<span class="sourceLineNo">002</span> * JFreeChart : a free chart library for the Java(tm) platform<a name="line.2"></a>
<span class="sourceLineNo">003</span> * ===========================================================<a name="line.3"></a>
<span class="sourceLineNo">004</span> *<a name="line.4"></a>
<span class="sourceLineNo">005</span> * (C) Copyright 2000-2011, by Object Refinery Limited and Contributors.<a name="line.5"></a>
<span class="sourceLineNo">006</span> *<a name="line.6"></a>
<span class="sourceLineNo">007</span> * Project Info:  http://www.jfree.org/jfreechart/index.html<a name="line.7"></a>
<span class="sourceLineNo">008</span> *<a name="line.8"></a>
<span class="sourceLineNo">009</span> * This library is free software; you can redistribute it and/or modify it<a name="line.9"></a>
<span class="sourceLineNo">010</span> * under the terms of the GNU Lesser General Public License as published by<a name="line.10"></a>
<span class="sourceLineNo">011</span> * the Free Software Foundation; either version 2.1 of the License, or<a name="line.11"></a>
<span class="sourceLineNo">012</span> * (at your option) any later version.<a name="line.12"></a>
<span class="sourceLineNo">013</span> *<a name="line.13"></a>
<span class="sourceLineNo">014</span> * This library is distributed in the hope that it will be useful, but<a name="line.14"></a>
<span class="sourceLineNo">015</span> * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY<a name="line.15"></a>
<span class="sourceLineNo">016</span> * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public<a name="line.16"></a>
<span class="sourceLineNo">017</span> * License for more details.<a name="line.17"></a>
<span class="sourceLineNo">018</span> *<a name="line.18"></a>
<span class="sourceLineNo">019</span> * You should have received a copy of the GNU Lesser General Public<a name="line.19"></a>
<span class="sourceLineNo">020</span> * License along with this library; if not, write to the Free Software<a name="line.20"></a>
<span class="sourceLineNo">021</span> * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301,<a name="line.21"></a>
<span class="sourceLineNo">022</span> * USA.<a name="line.22"></a>
<span class="sourceLineNo">023</span> *<a name="line.23"></a>
<span class="sourceLineNo">024</span> * [Oracle and Java are registered trademarks of Oracle and/or its affiliates. <a name="line.24"></a>
<span class="sourceLineNo">025</span> * Other names may be trademarks of their respective owners.]<a name="line.25"></a>
<span class="sourceLineNo">026</span> *<a name="line.26"></a>
<span class="sourceLineNo">027</span> * -----------<a name="line.27"></a>
<span class="sourceLineNo">028</span> * XYPlot.java<a name="line.28"></a>
<span class="sourceLineNo">029</span> * -----------<a name="line.29"></a>
<span class="sourceLineNo">030</span> * (C) Copyright 2000-2011, by Object Refinery Limited and Contributors.<a name="line.30"></a>
<span class="sourceLineNo">031</span> *<a name="line.31"></a>
<span class="sourceLineNo">032</span> * Original Author:  David Gilbert (for Object Refinery Limited);<a name="line.32"></a>
<span class="sourceLineNo">033</span> * Contributor(s):   Craig MacFarlane;<a name="line.33"></a>
<span class="sourceLineNo">034</span> *                   Mark Watson (www.markwatson.com);<a name="line.34"></a>
<span class="sourceLineNo">035</span> *                   Jonathan Nash;<a name="line.35"></a>
<span class="sourceLineNo">036</span> *                   Gideon Krause;<a name="line.36"></a>
<span class="sourceLineNo">037</span> *                   Klaus Rheinwald;<a name="line.37"></a>
<span class="sourceLineNo">038</span> *                   Xavier Poinsard;<a name="line.38"></a>
<span class="sourceLineNo">039</span> *                   Richard Atkinson;<a name="line.39"></a>
<span class="sourceLineNo">040</span> *                   Arnaud Lelievre;<a name="line.40"></a>
<span class="sourceLineNo">041</span> *                   Nicolas Brodu;<a name="line.41"></a>
<span class="sourceLineNo">042</span> *                   Eduardo Ramalho;<a name="line.42"></a>
<span class="sourceLineNo">043</span> *                   Sergei Ivanov;<a name="line.43"></a>
<span class="sourceLineNo">044</span> *                   Richard West, Advanced Micro Devices, Inc.;<a name="line.44"></a>
<span class="sourceLineNo">045</span> *                   Ulrich Voigt - patches 1997549 and 2686040;<a name="line.45"></a>
<span class="sourceLineNo">046</span> *                   Peter Kolb - patches 1934255, 2603321 and 2809117;<a name="line.46"></a>
<span class="sourceLineNo">047</span> *                   Andrew Mickish - patch 1868749;<a name="line.47"></a>
<span class="sourceLineNo">048</span> *<a name="line.48"></a>
<span class="sourceLineNo">049</span> * Changes (from 21-Jun-2001)<a name="line.49"></a>
<span class="sourceLineNo">050</span> * --------------------------<a name="line.50"></a>
<span class="sourceLineNo">051</span> * 21-Jun-2001 : Removed redundant JFreeChart parameter from constructors (DG);<a name="line.51"></a>
<span class="sourceLineNo">052</span> * 18-Sep-2001 : Updated header and fixed DOS encoding problem (DG);<a name="line.52"></a>
<span class="sourceLineNo">053</span> * 15-Oct-2001 : Data source classes moved to com.jrefinery.data.* (DG);<a name="line.53"></a>
<span class="sourceLineNo">054</span> * 19-Oct-2001 : Removed the code for drawing the visual representation of each<a name="line.54"></a>
<span class="sourceLineNo">055</span> *               data point into a separate class StandardXYItemRenderer.<a name="line.55"></a>
<span class="sourceLineNo">056</span> *               This will make it easier to add variations to the way the<a name="line.56"></a>
<span class="sourceLineNo">057</span> *               charts are drawn.  Based on code contributed by Mark<a name="line.57"></a>
<span class="sourceLineNo">058</span> *               Watson (DG);<a name="line.58"></a>
<span class="sourceLineNo">059</span> * 22-Oct-2001 : Renamed DataSource.java --&gt; Dataset.java etc. (DG);<a name="line.59"></a>
<span class="sourceLineNo">060</span> * 20-Nov-2001 : Fixed clipping bug that shows up when chart is displayed<a name="line.60"></a>
<span class="sourceLineNo">061</span> *               inside JScrollPane (DG);<a name="line.61"></a>
<span class="sourceLineNo">062</span> * 12-Dec-2001 : Removed unnecessary 'throws' clauses from constructor (DG);<a name="line.62"></a>
<span class="sourceLineNo">063</span> * 13-Dec-2001 : Added skeleton code for tooltips.  Added new constructor. (DG);<a name="line.63"></a>
<span class="sourceLineNo">064</span> * 16-Jan-2002 : Renamed the tooltips class (DG);<a name="line.64"></a>
<span class="sourceLineNo">065</span> * 22-Jan-2002 : Added DrawInfo class, incorporating tooltips and crosshairs.<a name="line.65"></a>
<span class="sourceLineNo">066</span> *               Crosshairs based on code by Jonathan Nash (DG);<a name="line.66"></a>
<span class="sourceLineNo">067</span> * 05-Feb-2002 : Added alpha-transparency setting based on code by Sylvain<a name="line.67"></a>
<span class="sourceLineNo">068</span> *               Vieujot (DG);<a name="line.68"></a>
<span class="sourceLineNo">069</span> * 26-Feb-2002 : Updated getMinimumXXX() and getMaximumXXX() methods to handle<a name="line.69"></a>
<span class="sourceLineNo">070</span> *               special case when chart is null (DG);<a name="line.70"></a>
<span class="sourceLineNo">071</span> * 28-Feb-2002 : Renamed Datasets.java --&gt; DatasetUtilities.java (DG);<a name="line.71"></a>
<span class="sourceLineNo">072</span> * 28-Mar-2002 : The plot now registers with the renderer as a property change<a name="line.72"></a>
<span class="sourceLineNo">073</span> *               listener.  Also added a new constructor (DG);<a name="line.73"></a>
<span class="sourceLineNo">074</span> * 09-Apr-2002 : Removed the transRangeZero from the renderer.drawItem()<a name="line.74"></a>
<span class="sourceLineNo">075</span> *               method.  Moved the tooltip generator into the renderer (DG);<a name="line.75"></a>
<span class="sourceLineNo">076</span> * 23-Apr-2002 : Fixed bug in methods for drawing horizontal and vertical<a name="line.76"></a>
<span class="sourceLineNo">077</span> *               lines (DG);<a name="line.77"></a>
<span class="sourceLineNo">078</span> * 13-May-2002 : Small change to the draw() method so that it works for<a name="line.78"></a>
<span class="sourceLineNo">079</span> *               OverlaidXYPlot also (DG);<a name="line.79"></a>
<span class="sourceLineNo">080</span> * 25-Jun-2002 : Removed redundant import (DG);<a name="line.80"></a>
<span class="sourceLineNo">081</span> * 20-Aug-2002 : Renamed getItemRenderer() --&gt; getRenderer(), and<a name="line.81"></a>
<span class="sourceLineNo">082</span> *               setXYItemRenderer() --&gt; setRenderer() (DG);<a name="line.82"></a>
<span class="sourceLineNo">083</span> * 28-Aug-2002 : Added mechanism for (optional) plot annotations (DG);<a name="line.83"></a>
<span class="sourceLineNo">084</span> * 02-Oct-2002 : Fixed errors reported by Checkstyle (DG);<a name="line.84"></a>
<span class="sourceLineNo">085</span> * 18-Nov-2002 : Added grid settings for both domain and range axis (previously<a name="line.85"></a>
<span class="sourceLineNo">086</span> *               these were set in the axes) (DG);<a name="line.86"></a>
<span class="sourceLineNo">087</span> * 09-Jan-2003 : Further additions to the grid settings, plus integrated plot<a name="line.87"></a>
<span class="sourceLineNo">088</span> *               border bug fix contributed by Gideon Krause (DG);<a name="line.88"></a>
<span class="sourceLineNo">089</span> * 22-Jan-2003 : Removed monolithic constructor (DG);<a name="line.89"></a>
<span class="sourceLineNo">090</span> * 04-Mar-2003 : Added 'no data' message, see bug report 691634.  Added<a name="line.90"></a>
<span class="sourceLineNo">091</span> *               secondary range markers using code contributed by Klaus<a name="line.91"></a>
<span class="sourceLineNo">092</span> *               Rheinwald (DG);<a name="line.92"></a>
<span class="sourceLineNo">093</span> * 26-Mar-2003 : Implemented Serializable (DG);<a name="line.93"></a>
<span class="sourceLineNo">094</span> * 03-Apr-2003 : Added setDomainAxisLocation() method (DG);<a name="line.94"></a>
<span class="sourceLineNo">095</span> * 30-Apr-2003 : Moved annotation drawing into a separate method (DG);<a name="line.95"></a>
<span class="sourceLineNo">096</span> * 01-May-2003 : Added multi-pass mechanism for renderers (DG);<a name="line.96"></a>
<span class="sourceLineNo">097</span> * 02-May-2003 : Changed axis locations from int to AxisLocation (DG);<a name="line.97"></a>
<span class="sourceLineNo">098</span> * 15-May-2003 : Added an orientation attribute (DG);<a name="line.98"></a>
<span class="sourceLineNo">099</span> * 02-Jun-2003 : Removed range axis compatibility test (DG);<a name="line.99"></a>
<span class="sourceLineNo">100</span> * 05-Jun-2003 : Added domain and range grid bands (sponsored by Focus Computer<a name="line.100"></a>
<span class="sourceLineNo">101</span> *               Services Ltd) (DG);<a name="line.101"></a>
<span class="sourceLineNo">102</span> * 26-Jun-2003 : Fixed bug (757303) in getDataRange() method (DG);<a name="line.102"></a>
<span class="sourceLineNo">103</span> * 02-Jul-2003 : Added patch from bug report 698646 (secondary axes for<a name="line.103"></a>
<span class="sourceLineNo">104</span> *               overlaid plots) (DG);<a name="line.104"></a>
<span class="sourceLineNo">105</span> * 23-Jul-2003 : Added support for multiple secondary datasets, axes and<a name="line.105"></a>
<span class="sourceLineNo">106</span> *               renderers (DG);<a name="line.106"></a>
<span class="sourceLineNo">107</span> * 27-Jul-2003 : Added support for stacked XY area charts (RA);<a name="line.107"></a>
<span class="sourceLineNo">108</span> * 19-Aug-2003 : Implemented Cloneable (DG);<a name="line.108"></a>
<span class="sourceLineNo">109</span> * 01-Sep-2003 : Fixed bug where change to secondary datasets didn't generate<a name="line.109"></a>
<span class="sourceLineNo">110</span> *               change event (797466) (DG)<a name="line.110"></a>
<span class="sourceLineNo">111</span> * 08-Sep-2003 : Added internationalization via use of properties<a name="line.111"></a>
<span class="sourceLineNo">112</span> *               resourceBundle (RFE 690236) (AL);<a name="line.112"></a>
<span class="sourceLineNo">113</span> * 08-Sep-2003 : Changed ValueAxis API (DG);<a name="line.113"></a>
<span class="sourceLineNo">114</span> * 08-Sep-2003 : Fixes for serialization (NB);<a name="line.114"></a>
<span class="sourceLineNo">115</span> * 16-Sep-2003 : Changed ChartRenderingInfo --&gt; PlotRenderingInfo (DG);<a name="line.115"></a>
<span class="sourceLineNo">116</span> * 17-Sep-2003 : Fixed zooming to include secondary domain axes (DG);<a name="line.116"></a>
<span class="sourceLineNo">117</span> * 18-Sep-2003 : Added getSecondaryDomainAxisCount() and<a name="line.117"></a>
<span class="sourceLineNo">118</span> *               getSecondaryRangeAxisCount() methods suggested by Eduardo<a name="line.118"></a>
<span class="sourceLineNo">119</span> *               Ramalho (RFE 808548) (DG);<a name="line.119"></a>
<span class="sourceLineNo">120</span> * 23-Sep-2003 : Split domain and range markers into foreground and<a name="line.120"></a>
<span class="sourceLineNo">121</span> *               background (DG);<a name="line.121"></a>
<span class="sourceLineNo">122</span> * 06-Oct-2003 : Fixed bug in clearDomainMarkers() and clearRangeMarkers()<a name="line.122"></a>
<span class="sourceLineNo">123</span> *               methods.  Fixed bug (815876) in addSecondaryRangeMarker()<a name="line.123"></a>
<span class="sourceLineNo">124</span> *               method.  Added new addSecondaryDomainMarker methods (see bug<a name="line.124"></a>
<span class="sourceLineNo">125</span> *               id 815869) (DG);<a name="line.125"></a>
<span class="sourceLineNo">126</span> * 10-Nov-2003 : Added getSecondaryDomain/RangeAxisMappedToDataset() methods<a name="line.126"></a>
<span class="sourceLineNo">127</span> *               requested by Eduardo Ramalho (DG);<a name="line.127"></a>
<span class="sourceLineNo">128</span> * 24-Nov-2003 : Removed unnecessary notification when updating axis anchor<a name="line.128"></a>
<span class="sourceLineNo">129</span> *               values (DG);<a name="line.129"></a>
<span class="sourceLineNo">130</span> * 21-Jan-2004 : Update for renamed method in ValueAxis (DG);<a name="line.130"></a>
<span class="sourceLineNo">131</span> * 25-Feb-2004 : Replaced CrosshairInfo with CrosshairState (DG);<a name="line.131"></a>
<span class="sourceLineNo">132</span> * 12-Mar-2004 : Fixed bug where primary renderer is always used to determine<a name="line.132"></a>
<span class="sourceLineNo">133</span> *               range type (DG);<a name="line.133"></a>
<span class="sourceLineNo">134</span> * 22-Mar-2004 : Fixed cloning bug (DG);<a name="line.134"></a>
<span class="sourceLineNo">135</span> * 23-Mar-2004 : Fixed more cloning bugs (DG);<a name="line.135"></a>
<span class="sourceLineNo">136</span> * 07-Apr-2004 : Fixed problem with axis range when the secondary renderer is<a name="line.136"></a>
<span class="sourceLineNo">137</span> *               stacked, see this post in the forum:<a name="line.137"></a>
<span class="sourceLineNo">138</span> *               http://www.jfree.org/phpBB2/viewtopic.php?t=8204 (DG);<a name="line.138"></a>
<span class="sourceLineNo">139</span> * 07-Apr-2004 : Added get/setDatasetRenderingOrder() methods (DG);<a name="line.139"></a>
<span class="sourceLineNo">140</span> * 26-Apr-2004 : Added option to fill quadrant areas in the background of the<a name="line.140"></a>
<span class="sourceLineNo">141</span> *               plot (DG);<a name="line.141"></a>
<span class="sourceLineNo">142</span> * 27-Apr-2004 : Removed major distinction between primary and secondary<a name="line.142"></a>
<span class="sourceLineNo">143</span> *               datasets, renderers and axes (DG);<a name="line.143"></a>
<span class="sourceLineNo">144</span> * 30-Apr-2004 : Modified to make use of the new getRangeExtent() method in the<a name="line.144"></a>
<span class="sourceLineNo">145</span> *               renderer interface (DG);<a name="line.145"></a>
<span class="sourceLineNo">146</span> * 13-May-2004 : Added optional fixedLegendItems attribute (DG);<a name="line.146"></a>
<span class="sourceLineNo">147</span> * 19-May-2004 : Added indexOf() method (DG);<a name="line.147"></a>
<span class="sourceLineNo">148</span> * 03-Jun-2004 : Fixed zooming bug (DG);<a name="line.148"></a>
<span class="sourceLineNo">149</span> * 18-Aug-2004 : Added removedAnnotation() method (by tkram01) (DG);<a name="line.149"></a>
<span class="sourceLineNo">150</span> * 05-Oct-2004 : Modified storage type for dataset-to-axis maps (DG);<a name="line.150"></a>
<span class="sourceLineNo">151</span> * 06-Oct-2004 : Modified getDataRange() method to use renderer to determine<a name="line.151"></a>
<span class="sourceLineNo">152</span> *               the x-value range (now matches behaviour for y-values).  Added<a name="line.152"></a>
<span class="sourceLineNo">153</span> *               getDomainAxisIndex() method (DG);<a name="line.153"></a>
<span class="sourceLineNo">154</span> * 12-Nov-2004 : Implemented new Zoomable interface (DG);<a name="line.154"></a>
<span class="sourceLineNo">155</span> * 25-Nov-2004 : Small update to clone() implementation (DG);<a name="line.155"></a>
<span class="sourceLineNo">156</span> * 22-Feb-2005 : Changed axis offsets from Spacer --&gt; RectangleInsets (DG);<a name="line.156"></a>
<span class="sourceLineNo">157</span> * 24-Feb-2005 : Added indexOf(XYItemRenderer) method (DG);<a name="line.157"></a>
<span class="sourceLineNo">158</span> * 21-Mar-2005 : Register plot as change listener in setRenderer() method (DG);<a name="line.158"></a>
<span class="sourceLineNo">159</span> * 21-Apr-2005 : Added get/setSeriesRenderingOrder() methods (ET);<a name="line.159"></a>
<span class="sourceLineNo">160</span> * 26-Apr-2005 : Removed LOGGER (DG);<a name="line.160"></a>
<span class="sourceLineNo">161</span> * 04-May-2005 : Fixed serialization of domain and range markers (DG);<a name="line.161"></a>
<span class="sourceLineNo">162</span> * 05-May-2005 : Removed unused draw() method (DG);<a name="line.162"></a>
<span class="sourceLineNo">163</span> * 20-May-2005 : Added setDomainAxes() and setRangeAxes() methods, as per<a name="line.163"></a>
<span class="sourceLineNo">164</span> *               RFE 1183100 (DG);<a name="line.164"></a>
<span class="sourceLineNo">165</span> * 01-Jun-2005 : Upon deserialization, register plot as a listener with its<a name="line.165"></a>
<span class="sourceLineNo">166</span> *               axes, dataset(s) and renderer(s) - see patch 1209475 (DG);<a name="line.166"></a>
<span class="sourceLineNo">167</span> * 01-Jun-2005 : Added clearDomainMarkers(int) method to match<a name="line.167"></a>
<span class="sourceLineNo">168</span> *               clearRangeMarkers(int) (DG);<a name="line.168"></a>
<span class="sourceLineNo">169</span> * 06-Jun-2005 : Fixed equals() method to handle GradientPaint (DG);<a name="line.169"></a>
<span class="sourceLineNo">170</span> * 09-Jun-2005 : Added setRenderers(), as per RFE 1183100 (DG);<a name="line.170"></a>
<span class="sourceLineNo">171</span> * 06-Jul-2005 : Fixed crosshair bug (id = 1233336) (DG);<a name="line.171"></a>
<span class="sourceLineNo">172</span> * ------------- JFREECHART 1.0.x ---------------------------------------------<a name="line.172"></a>
<span class="sourceLineNo">173</span> * 26-Jan-2006 : Added getAnnotations() method (DG);<a name="line.173"></a>
<span class="sourceLineNo">174</span> * 05-Sep-2006 : Added MarkerChangeEvent support (DG);<a name="line.174"></a>
<span class="sourceLineNo">175</span> * 13-Oct-2006 : Fixed initialisation of CrosshairState - see bug report<a name="line.175"></a>
<span class="sourceLineNo">176</span> *               1565168 (DG);<a name="line.176"></a>
<span class="sourceLineNo">177</span> * 22-Nov-2006 : Fixed equals() and cloning() for quadrant attributes, plus<a name="line.177"></a>
<span class="sourceLineNo">178</span> *               API doc updates (DG);<a name="line.178"></a>
<span class="sourceLineNo">179</span> * 29-Nov-2006 : Added argument checks (DG);<a name="line.179"></a>
<span class="sourceLineNo">180</span> * 15-Jan-2007 : Fixed bug in drawRangeMarkers() (DG);<a name="line.180"></a>
<span class="sourceLineNo">181</span> * 07-Feb-2007 : Fixed bug 1654215, renderer with no dataset (DG);<a name="line.181"></a>
<span class="sourceLineNo">182</span> * 26-Feb-2007 : Added missing setDomainAxisLocation() and<a name="line.182"></a>
<span class="sourceLineNo">183</span> *               setRangeAxisLocation() methods (DG);<a name="line.183"></a>
<span class="sourceLineNo">184</span> * 02-Mar-2007 : Fix for crosshair positioning with horizontal orientation<a name="line.184"></a>
<span class="sourceLineNo">185</span> *               (see patch 1671648 by Sergei Ivanov) (DG);<a name="line.185"></a>
<span class="sourceLineNo">186</span> * 13-Mar-2007 : Added null argument checks for crosshair attributes (DG);<a name="line.186"></a>
<span class="sourceLineNo">187</span> * 23-Mar-2007 : Added domain zero base line facility (DG);<a name="line.187"></a>
<span class="sourceLineNo">188</span> * 04-May-2007 : Render only visible data items if possible (DG);<a name="line.188"></a>
<span class="sourceLineNo">189</span> * 24-May-2007 : Fixed bug in render method for an empty series (DG);<a name="line.189"></a>
<span class="sourceLineNo">190</span> * 07-Jun-2007 : Modified drawBackground() to pass orientation to<a name="line.190"></a>
<span class="sourceLineNo">191</span> *               fillBackground() for handling GradientPaint (DG);<a name="line.191"></a>
<span class="sourceLineNo">192</span> * 24-Sep-2007 : Added new zoom methods (DG);<a name="line.192"></a>
<span class="sourceLineNo">193</span> * 26-Sep-2007 : Include index value in IllegalArgumentExceptions (DG);<a name="line.193"></a>
<span class="sourceLineNo">194</span> * 05-Nov-2007 : Applied patch 1823697, by Richard West, for removal of domain<a name="line.194"></a>
<span class="sourceLineNo">195</span> *               and range markers (DG);<a name="line.195"></a>
<span class="sourceLineNo">196</span> * 12-Nov-2007 : Fixed bug in equals() method for domain and range tick<a name="line.196"></a>
<span class="sourceLineNo">197</span> *               band paint attributes (DG);<a name="line.197"></a>
<span class="sourceLineNo">198</span> * 27-Nov-2007 : Added new setFixedDomain/RangeAxisSpace() methods (DG);<a name="line.198"></a>
<span class="sourceLineNo">199</span> * 04-Jan-2008 : Fix for quadrant painting error - see patch 1849564 (DG);<a name="line.199"></a>
<span class="sourceLineNo">200</span> * 25-Mar-2008 : Added new methods with optional notification - see patch<a name="line.200"></a>
<span class="sourceLineNo">201</span> *               1913751 (DG);<a name="line.201"></a>
<span class="sourceLineNo">202</span> * 07-Apr-2008 : Fixed NPE in removeDomainMarker() and<a name="line.202"></a>
<span class="sourceLineNo">203</span> *               removeRangeMarker() (DG);<a name="line.203"></a>
<span class="sourceLineNo">204</span> * 22-May-2008 : Modified calculateAxisSpace() to process range axes first,<a name="line.204"></a>
<span class="sourceLineNo">205</span> *               then adjust the plot area before calculating the space<a name="line.205"></a>
<span class="sourceLineNo">206</span> *               for the domain axes (DG);<a name="line.206"></a>
<span class="sourceLineNo">207</span> * 09-Jul-2008 : Added renderer state notification when series pass begins<a name="line.207"></a>
<span class="sourceLineNo">208</span> *               and ends - see patch 1997549 by Ulrich Voigt (DG);<a name="line.208"></a>
<span class="sourceLineNo">209</span> * 25-Jul-2008 : Fixed NullPointerException for plots with no axes (DG);<a name="line.209"></a>
<span class="sourceLineNo">210</span> * 15-Aug-2008 : Added getRendererCount() method (DG);<a name="line.210"></a>
<span class="sourceLineNo">211</span> * 25-Sep-2008 : Added minor tick support, see patch 1934255 by Peter Kolb (DG);<a name="line.211"></a>
<span class="sourceLineNo">212</span> * 25-Nov-2008 : Allow datasets to be mapped to multiple axes - based on patch<a name="line.212"></a>
<span class="sourceLineNo">213</span> *               1868749 by Andrew Mickish (DG);<a name="line.213"></a>
<span class="sourceLineNo">214</span> * 18-Dec-2008 : Use ResourceBundleWrapper - see patch 1607918 by<a name="line.214"></a>
<span class="sourceLineNo">215</span> *               Jess Thrysoee (DG);<a name="line.215"></a>
<span class="sourceLineNo">216</span> * 10-Mar-2009 : Allow some annotations to contribute to axis autoRange (DG);<a name="line.216"></a>
<span class="sourceLineNo">217</span> * 18-Mar-2009 : Modified anchored zoom behaviour and fixed bug in<a name="line.217"></a>
<span class="sourceLineNo">218</span> *               "process visible range" rendering (DG);<a name="line.218"></a>
<span class="sourceLineNo">219</span> * 19-Mar-2009 : Added panning support based on patch 2686040 by Ulrich<a name="line.219"></a>
<span class="sourceLineNo">220</span> *               Voigt (DG);<a name="line.220"></a>
<span class="sourceLineNo">221</span> * 19-Mar-2009 : Added entity support - see patch 2603321 by Peter Kolb (DG);<a name="line.221"></a>
<span class="sourceLineNo">222</span> * 30-Mar-2009 : Delegate panning to axes (DG);<a name="line.222"></a>
<span class="sourceLineNo">223</span> * 10-May-2009 : Added check for fixedLegendItems in equals(), and code to<a name="line.223"></a>
<span class="sourceLineNo">224</span> *               handle cloning (DG);<a name="line.224"></a>
<span class="sourceLineNo">225</span> * 24-Jun-2009 : Added support for annotation events - see patch 2809117<a name="line.225"></a>
<span class="sourceLineNo">226</span> *               by PK (DG);<a name="line.226"></a>
<span class="sourceLineNo">227</span> * 06-Jul-2009 : Fix for cloning of renderers - see bug 2817504 (DG)<a name="line.227"></a>
<span class="sourceLineNo">228</span> * 10-Jul-2009 : Added optional drop shadow generator (DG);<a name="line.228"></a>
<span class="sourceLineNo">229</span> * 18-Oct-2011 : Fix tooltip offset with shadow renderer (DG);<a name="line.229"></a>
<span class="sourceLineNo">230</span> *<a name="line.230"></a>
<span class="sourceLineNo">231</span> */<a name="line.231"></a>
<span class="sourceLineNo">232</span><a name="line.232"></a>
<span class="sourceLineNo">233</span>package org.jfree.chart.plot;<a name="line.233"></a>
<span class="sourceLineNo">234</span><a name="line.234"></a>
<span class="sourceLineNo">235</span>import java.awt.AlphaComposite;<a name="line.235"></a>
<span class="sourceLineNo">236</span>import java.awt.BasicStroke;<a name="line.236"></a>
<span class="sourceLineNo">237</span>import java.awt.Color;<a name="line.237"></a>
<span class="sourceLineNo">238</span>import java.awt.Composite;<a name="line.238"></a>
<span class="sourceLineNo">239</span>import java.awt.Graphics2D;<a name="line.239"></a>
<span class="sourceLineNo">240</span>import java.awt.Paint;<a name="line.240"></a>
<span class="sourceLineNo">241</span>import java.awt.Rectangle;<a name="line.241"></a>
<span class="sourceLineNo">242</span>import java.awt.Shape;<a name="line.242"></a>
<span class="sourceLineNo">243</span>import java.awt.Stroke;<a name="line.243"></a>
<span class="sourceLineNo">244</span>import java.awt.geom.Line2D;<a name="line.244"></a>
<span class="sourceLineNo">245</span>import java.awt.geom.Point2D;<a name="line.245"></a>
<span class="sourceLineNo">246</span>import java.awt.geom.Rectangle2D;<a name="line.246"></a>
<span class="sourceLineNo">247</span>import java.awt.image.BufferedImage;<a name="line.247"></a>
<span class="sourceLineNo">248</span>import java.io.IOException;<a name="line.248"></a>
<span class="sourceLineNo">249</span>import java.io.ObjectInputStream;<a name="line.249"></a>
<span class="sourceLineNo">250</span>import java.io.ObjectOutputStream;<a name="line.250"></a>
<span class="sourceLineNo">251</span>import java.io.Serializable;<a name="line.251"></a>
<span class="sourceLineNo">252</span>import java.util.ArrayList;<a name="line.252"></a>
<span class="sourceLineNo">253</span>import java.util.Collection;<a name="line.253"></a>
<span class="sourceLineNo">254</span>import java.util.Collections;<a name="line.254"></a>
<span class="sourceLineNo">255</span>import java.util.HashMap;<a name="line.255"></a>
<span class="sourceLineNo">256</span>import java.util.HashSet;<a name="line.256"></a>
<span class="sourceLineNo">257</span>import java.util.Iterator;<a name="line.257"></a>
<span class="sourceLineNo">258</span>import java.util.List;<a name="line.258"></a>
<span class="sourceLineNo">259</span>import java.util.Map;<a name="line.259"></a>
<span class="sourceLineNo">260</span>import java.util.ResourceBundle;<a name="line.260"></a>
<span class="sourceLineNo">261</span>import java.util.Set;<a name="line.261"></a>
<span class="sourceLineNo">262</span>import java.util.TreeMap;<a name="line.262"></a>
<span class="sourceLineNo">263</span><a name="line.263"></a>
<span class="sourceLineNo">264</span>import org.jfree.chart.LegendItem;<a name="line.264"></a>
<span class="sourceLineNo">265</span>import org.jfree.chart.LegendItemCollection;<a name="line.265"></a>
<span class="sourceLineNo">266</span>import org.jfree.chart.annotations.Annotation;<a name="line.266"></a>
<span class="sourceLineNo">267</span>import org.jfree.chart.annotations.XYAnnotation;<a name="line.267"></a>
<span class="sourceLineNo">268</span>import org.jfree.chart.annotations.XYAnnotationBoundsInfo;<a name="line.268"></a>
<span class="sourceLineNo">269</span>import org.jfree.chart.axis.Axis;<a name="line.269"></a>
<span class="sourceLineNo">270</span>import org.jfree.chart.axis.AxisCollection;<a name="line.270"></a>
<span class="sourceLineNo">271</span>import org.jfree.chart.axis.AxisLocation;<a name="line.271"></a>
<span class="sourceLineNo">272</span>import org.jfree.chart.axis.AxisSpace;<a name="line.272"></a>
<span class="sourceLineNo">273</span>import org.jfree.chart.axis.AxisState;<a name="line.273"></a>
<span class="sourceLineNo">274</span>import org.jfree.chart.axis.TickType;<a name="line.274"></a>
<span class="sourceLineNo">275</span>import org.jfree.chart.axis.ValueAxis;<a name="line.275"></a>
<span class="sourceLineNo">276</span>import org.jfree.chart.axis.ValueTick;<a name="line.276"></a>
<span class="sourceLineNo">277</span>import org.jfree.chart.event.AnnotationChangeEvent;<a name="line.277"></a>
<span class="sourceLineNo">278</span>import org.jfree.chart.event.ChartChangeEventType;<a name="line.278"></a>
<span class="sourceLineNo">279</span>import org.jfree.chart.event.PlotChangeEvent;<a name="line.279"></a>
<span class="sourceLineNo">280</span>import org.jfree.chart.event.RendererChangeEvent;<a name="line.280"></a>
<span class="sourceLineNo">281</span>import org.jfree.chart.event.RendererChangeListener;<a name="line.281"></a>
<span class="sourceLineNo">282</span>import org.jfree.chart.renderer.RendererUtilities;<a name="line.282"></a>
<span class="sourceLineNo">283</span>import org.jfree.chart.renderer.xy.AbstractXYItemRenderer;<a name="line.283"></a>
<span class="sourceLineNo">284</span>import org.jfree.chart.renderer.xy.XYItemRenderer;<a name="line.284"></a>
<span class="sourceLineNo">285</span>import org.jfree.chart.renderer.xy.XYItemRendererState;<a name="line.285"></a>
<span class="sourceLineNo">286</span>import org.jfree.chart.util.ResourceBundleWrapper;<a name="line.286"></a>
<span class="sourceLineNo">287</span>import org.jfree.chart.util.ShadowGenerator;<a name="line.287"></a>
<span class="sourceLineNo">288</span>import org.jfree.data.Range;<a name="line.288"></a>
<span class="sourceLineNo">289</span>import org.jfree.data.general.Dataset;<a name="line.289"></a>
<span class="sourceLineNo">290</span>import org.jfree.data.general.DatasetChangeEvent;<a name="line.290"></a>
<span class="sourceLineNo">291</span>import org.jfree.data.general.DatasetUtilities;<a name="line.291"></a>
<span class="sourceLineNo">292</span>import org.jfree.data.xy.XYDataset;<a name="line.292"></a>
<span class="sourceLineNo">293</span>import org.jfree.io.SerialUtilities;<a name="line.293"></a>
<span class="sourceLineNo">294</span>import org.jfree.ui.Layer;<a name="line.294"></a>
<span class="sourceLineNo">295</span>import org.jfree.ui.RectangleEdge;<a name="line.295"></a>
<span class="sourceLineNo">296</span>import org.jfree.ui.RectangleInsets;<a name="line.296"></a>
<span class="sourceLineNo">297</span>import org.jfree.util.ObjectList;<a name="line.297"></a>
<span class="sourceLineNo">298</span>import org.jfree.util.ObjectUtilities;<a name="line.298"></a>
<span class="sourceLineNo">299</span>import org.jfree.util.PaintUtilities;<a name="line.299"></a>
<span class="sourceLineNo">300</span>import org.jfree.util.PublicCloneable;<a name="line.300"></a>
<span class="sourceLineNo">301</span><a name="line.301"></a>
<span class="sourceLineNo">302</span>/**<a name="line.302"></a>
<span class="sourceLineNo">303</span> * A general class for plotting data in the form of (x, y) pairs.  This plot can<a name="line.303"></a>
<span class="sourceLineNo">304</span> * use data from any class that implements the {@link XYDataset} interface.<a name="line.304"></a>
<span class="sourceLineNo">305</span> * &lt;P&gt;<a name="line.305"></a>
<span class="sourceLineNo">306</span> * &lt;code&gt;XYPlot&lt;/code&gt; makes use of an {@link XYItemRenderer} to draw each point<a name="line.306"></a>
<span class="sourceLineNo">307</span> * on the plot.  By using different renderers, various chart types can be<a name="line.307"></a>
<span class="sourceLineNo">308</span> * produced.<a name="line.308"></a>
<span class="sourceLineNo">309</span> * &lt;p&gt;<a name="line.309"></a>
<span class="sourceLineNo">310</span> * The {@link org.jfree.chart.ChartFactory} class contains static methods for<a name="line.310"></a>
<span class="sourceLineNo">311</span> * creating pre-configured charts.<a name="line.311"></a>
<span class="sourceLineNo">312</span> */<a name="line.312"></a>
<span class="sourceLineNo">313</span>public class XYPlot extends Plot implements ValueAxisPlot, Pannable, Zoomable,<a name="line.313"></a>
<span class="sourceLineNo">314</span>        RendererChangeListener, Cloneable, PublicCloneable, Serializable {<a name="line.314"></a>
<span class="sourceLineNo">315</span><a name="line.315"></a>
<span class="sourceLineNo">316</span>    /** For serialization. */<a name="line.316"></a>
<span class="sourceLineNo">317</span>    private static final long serialVersionUID = 7044148245716569264L;<a name="line.317"></a>
<span class="sourceLineNo">318</span><a name="line.318"></a>
<span class="sourceLineNo">319</span>    /** The default grid line stroke. */<a name="line.319"></a>
<span class="sourceLineNo">320</span>    public static final Stroke DEFAULT_GRIDLINE_STROKE = new BasicStroke(0.5f,<a name="line.320"></a>
<span class="sourceLineNo">321</span>            BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL, 0.0f,<a name="line.321"></a>
<span class="sourceLineNo">322</span>            new float[] {2.0f, 2.0f}, 0.0f);<a name="line.322"></a>
<span class="sourceLineNo">323</span><a name="line.323"></a>
<span class="sourceLineNo">324</span>    /** The default grid line paint. */<a name="line.324"></a>
<span class="sourceLineNo">325</span>    public static final Paint DEFAULT_GRIDLINE_PAINT = Color.lightGray;<a name="line.325"></a>
<span class="sourceLineNo">326</span><a name="line.326"></a>
<span class="sourceLineNo">327</span>    /** The default crosshair visibility. */<a name="line.327"></a>
<span class="sourceLineNo">328</span>    public static final boolean DEFAULT_CROSSHAIR_VISIBLE = false;<a name="line.328"></a>
<span class="sourceLineNo">329</span><a name="line.329"></a>
<span class="sourceLineNo">330</span>    /** The default crosshair stroke. */<a name="line.330"></a>
<span class="sourceLineNo">331</span>    public static final Stroke DEFAULT_CROSSHAIR_STROKE<a name="line.331"></a>
<span class="sourceLineNo">332</span>            = DEFAULT_GRIDLINE_STROKE;<a name="line.332"></a>
<span class="sourceLineNo">333</span><a name="line.333"></a>
<span class="sourceLineNo">334</span>    /** The default crosshair paint. */<a name="line.334"></a>
<span class="sourceLineNo">335</span>    public static final Paint DEFAULT_CROSSHAIR_PAINT = Color.blue;<a name="line.335"></a>
<span class="sourceLineNo">336</span><a name="line.336"></a>
<span class="sourceLineNo">337</span>    /** The resourceBundle for the localization. */<a name="line.337"></a>
<span class="sourceLineNo">338</span>    protected static ResourceBundle localizationResources<a name="line.338"></a>
<span class="sourceLineNo">339</span>            = ResourceBundleWrapper.getBundle(<a name="line.339"></a>
<span class="sourceLineNo">340</span>                    "org.jfree.chart.plot.LocalizationBundle");<a name="line.340"></a>
<span class="sourceLineNo">341</span><a name="line.341"></a>
<span class="sourceLineNo">342</span>    /** The plot orientation. */<a name="line.342"></a>
<span class="sourceLineNo">343</span>    private PlotOrientation orientation;<a name="line.343"></a>
<span class="sourceLineNo">344</span><a name="line.344"></a>
<span class="sourceLineNo">345</span>    /** The offset between the data area and the axes. */<a name="line.345"></a>
<span class="sourceLineNo">346</span>    private RectangleInsets axisOffset;<a name="line.346"></a>
<span class="sourceLineNo">347</span><a name="line.347"></a>
<span class="sourceLineNo">348</span>    /** The domain axis / axes (used for the x-values). */<a name="line.348"></a>
<span class="sourceLineNo">349</span>    private ObjectList domainAxes;<a name="line.349"></a>
<span class="sourceLineNo">350</span><a name="line.350"></a>
<span class="sourceLineNo">351</span>    /** The domain axis locations. */<a name="line.351"></a>
<span class="sourceLineNo">352</span>    private ObjectList domainAxisLocations;<a name="line.352"></a>
<span class="sourceLineNo">353</span><a name="line.353"></a>
<span class="sourceLineNo">354</span>    /** The range axis (used for the y-values). */<a name="line.354"></a>
<span class="sourceLineNo">355</span>    private ObjectList rangeAxes;<a name="line.355"></a>
<span class="sourceLineNo">356</span><a name="line.356"></a>
<span class="sourceLineNo">357</span>    /** The range axis location. */<a name="line.357"></a>
<span class="sourceLineNo">358</span>    private ObjectList rangeAxisLocations;<a name="line.358"></a>
<span class="sourceLineNo">359</span><a name="line.359"></a>
<span class="sourceLineNo">360</span>    /** Storage for the datasets. */<a name="line.360"></a>
<span class="sourceLineNo">361</span>    private ObjectList datasets;<a name="line.361"></a>
<span class="sourceLineNo">362</span><a name="line.362"></a>
<span class="sourceLineNo">363</span>    /** Storage for the renderers. */<a name="line.363"></a>
<span class="sourceLineNo">364</span>    private ObjectList renderers;<a name="line.364"></a>
<span class="sourceLineNo">365</span><a name="line.365"></a>
<span class="sourceLineNo">366</span>    /**<a name="line.366"></a>
<span class="sourceLineNo">367</span>     * Storage for the mapping between datasets/renderers and domain axes.  The<a name="line.367"></a>
<span class="sourceLineNo">368</span>     * keys in the map are Integer objects, corresponding to the dataset<a name="line.368"></a>
<span class="sourceLineNo">369</span>     * index.  The values in the map are List objects containing Integer<a name="line.369"></a>
<span class="sourceLineNo">370</span>     * objects (corresponding to the axis indices).  If the map contains no<a name="line.370"></a>
<span class="sourceLineNo">371</span>     * entry for a dataset, it is assumed to map to the primary domain axis<a name="line.371"></a>
<span class="sourceLineNo">372</span>     * (index = 0).<a name="line.372"></a>
<span class="sourceLineNo">373</span>     */<a name="line.373"></a>
<span class="sourceLineNo">374</span>    private Map datasetToDomainAxesMap;<a name="line.374"></a>
<span class="sourceLineNo">375</span><a name="line.375"></a>
<span class="sourceLineNo">376</span>    /**<a name="line.376"></a>
<span class="sourceLineNo">377</span>     * Storage for the mapping between datasets/renderers and range axes.  The<a name="line.377"></a>
<span class="sourceLineNo">378</span>     * keys in the map are Integer objects, corresponding to the dataset<a name="line.378"></a>
<span class="sourceLineNo">379</span>     * index.  The values in the map are List objects containing Integer<a name="line.379"></a>
<span class="sourceLineNo">380</span>     * objects (corresponding to the axis indices).  If the map contains no<a name="line.380"></a>
<span class="sourceLineNo">381</span>     * entry for a dataset, it is assumed to map to the primary domain axis<a name="line.381"></a>
<span class="sourceLineNo">382</span>     * (index = 0).<a name="line.382"></a>
<span class="sourceLineNo">383</span>     */<a name="line.383"></a>
<span class="sourceLineNo">384</span>    private Map datasetToRangeAxesMap;<a name="line.384"></a>
<span class="sourceLineNo">385</span><a name="line.385"></a>
<span class="sourceLineNo">386</span>    /** The origin point for the quadrants (if drawn). */<a name="line.386"></a>
<span class="sourceLineNo">387</span>    private transient Point2D quadrantOrigin = new Point2D.Double(0.0, 0.0);<a name="line.387"></a>
<span class="sourceLineNo">388</span><a name="line.388"></a>
<span class="sourceLineNo">389</span>    /** The paint used for each quadrant. */<a name="line.389"></a>
<span class="sourceLineNo">390</span>    private transient Paint[] quadrantPaint<a name="line.390"></a>
<span class="sourceLineNo">391</span>            = new Paint[] {null, null, null, null};<a name="line.391"></a>
<span class="sourceLineNo">392</span><a name="line.392"></a>
<span class="sourceLineNo">393</span>    /** A flag that controls whether the domain grid-lines are visible. */<a name="line.393"></a>
<span class="sourceLineNo">394</span>    private boolean domainGridlinesVisible;<a name="line.394"></a>
<span class="sourceLineNo">395</span><a name="line.395"></a>
<span class="sourceLineNo">396</span>    /** The stroke used to draw the domain grid-lines. */<a name="line.396"></a>
<span class="sourceLineNo">397</span>    private transient Stroke domainGridlineStroke;<a name="line.397"></a>
<span class="sourceLineNo">398</span><a name="line.398"></a>
<span class="sourceLineNo">399</span>    /** The paint used to draw the domain grid-lines. */<a name="line.399"></a>
<span class="sourceLineNo">400</span>    private transient Paint domainGridlinePaint;<a name="line.400"></a>
<span class="sourceLineNo">401</span><a name="line.401"></a>
<span class="sourceLineNo">402</span>    /** A flag that controls whether the range grid-lines are visible. */<a name="line.402"></a>
<span class="sourceLineNo">403</span>    private boolean rangeGridlinesVisible;<a name="line.403"></a>
<span class="sourceLineNo">404</span><a name="line.404"></a>
<span class="sourceLineNo">405</span>    /** The stroke used to draw the range grid-lines. */<a name="line.405"></a>
<span class="sourceLineNo">406</span>    private transient Stroke rangeGridlineStroke;<a name="line.406"></a>
<span class="sourceLineNo">407</span><a name="line.407"></a>
<span class="sourceLineNo">408</span>    /** The paint used to draw the range grid-lines. */<a name="line.408"></a>
<span class="sourceLineNo">409</span>    private transient Paint rangeGridlinePaint;<a name="line.409"></a>
<span class="sourceLineNo">410</span><a name="line.410"></a>
<span class="sourceLineNo">411</span>    /**<a name="line.411"></a>
<span class="sourceLineNo">412</span>     * A flag that controls whether the domain minor grid-lines are visible.<a name="line.412"></a>
<span class="sourceLineNo">413</span>     *<a name="line.413"></a>
<span class="sourceLineNo">414</span>     * @since 1.0.12<a name="line.414"></a>
<span class="sourceLineNo">415</span>     */<a name="line.415"></a>
<span class="sourceLineNo">416</span>    private boolean domainMinorGridlinesVisible;<a name="line.416"></a>
<span class="sourceLineNo">417</span><a name="line.417"></a>
<span class="sourceLineNo">418</span>    /**<a name="line.418"></a>
<span class="sourceLineNo">419</span>     * The stroke used to draw the domain minor grid-lines.<a name="line.419"></a>
<span class="sourceLineNo">420</span>     *<a name="line.420"></a>
<span class="sourceLineNo">421</span>     * @since 1.0.12<a name="line.421"></a>
<span class="sourceLineNo">422</span>     */<a name="line.422"></a>
<span class="sourceLineNo">423</span>    private transient Stroke domainMinorGridlineStroke;<a name="line.423"></a>
<span class="sourceLineNo">424</span><a name="line.424"></a>
<span class="sourceLineNo">425</span>    /**<a name="line.425"></a>
<span class="sourceLineNo">426</span>     * The paint used to draw the domain minor grid-lines.<a name="line.426"></a>
<span class="sourceLineNo">427</span>     *<a name="line.427"></a>
<span class="sourceLineNo">428</span>     * @since 1.0.12<a name="line.428"></a>
<span class="sourceLineNo">429</span>     */<a name="line.429"></a>
<span class="sourceLineNo">430</span>    private transient Paint domainMinorGridlinePaint;<a name="line.430"></a>
<span class="sourceLineNo">431</span><a name="line.431"></a>
<span class="sourceLineNo">432</span>    /**<a name="line.432"></a>
<span class="sourceLineNo">433</span>     * A flag that controls whether the range minor grid-lines are visible.<a name="line.433"></a>
<span class="sourceLineNo">434</span>     *<a name="line.434"></a>
<span class="sourceLineNo">435</span>     * @since 1.0.12<a name="line.435"></a>
<span class="sourceLineNo">436</span>     */<a name="line.436"></a>
<span class="sourceLineNo">437</span>    private boolean rangeMinorGridlinesVisible;<a name="line.437"></a>
<span class="sourceLineNo">438</span><a name="line.438"></a>
<span class="sourceLineNo">439</span>    /**<a name="line.439"></a>
<span class="sourceLineNo">440</span>     * The stroke used to draw the range minor grid-lines.<a name="line.440"></a>
<span class="sourceLineNo">441</span>     *<a name="line.441"></a>
<span class="sourceLineNo">442</span>     * @since 1.0.12<a name="line.442"></a>
<span class="sourceLineNo">443</span>     */<a name="line.443"></a>
<span class="sourceLineNo">444</span>    private transient Stroke rangeMinorGridlineStroke;<a name="line.444"></a>
<span class="sourceLineNo">445</span><a name="line.445"></a>
<span class="sourceLineNo">446</span>    /**<a name="line.446"></a>
<span class="sourceLineNo">447</span>     * The paint used to draw the range minor grid-lines.<a name="line.447"></a>
<span class="sourceLineNo">448</span>     *<a name="line.448"></a>
<span class="sourceLineNo">449</span>     * @since 1.0.12<a name="line.449"></a>
<span class="sourceLineNo">450</span>     */<a name="line.450"></a>
<span class="sourceLineNo">451</span>    private transient Paint rangeMinorGridlinePaint;<a name="line.451"></a>
<span class="sourceLineNo">452</span><a name="line.452"></a>
<span class="sourceLineNo">453</span>    /**<a name="line.453"></a>
<span class="sourceLineNo">454</span>     * A flag that controls whether or not the zero baseline against the domain<a name="line.454"></a>
<span class="sourceLineNo">455</span>     * axis is visible.<a name="line.455"></a>
<span class="sourceLineNo">456</span>     *<a name="line.456"></a>
<span class="sourceLineNo">457</span>     * @since 1.0.5<a name="line.457"></a>
<span class="sourceLineNo">458</span>     */<a name="line.458"></a>
<span class="sourceLineNo">459</span>    private boolean domainZeroBaselineVisible;<a name="line.459"></a>
<span class="sourceLineNo">460</span><a name="line.460"></a>
<span class="sourceLineNo">461</span>    /**<a name="line.461"></a>
<span class="sourceLineNo">462</span>     * The stroke used for the zero baseline against the domain axis.<a name="line.462"></a>
<span class="sourceLineNo">463</span>     *<a name="line.463"></a>
<span class="sourceLineNo">464</span>     * @since 1.0.5<a name="line.464"></a>
<span class="sourceLineNo">465</span>     */<a name="line.465"></a>
<span class="sourceLineNo">466</span>    private transient Stroke domainZeroBaselineStroke;<a name="line.466"></a>
<span class="sourceLineNo">467</span><a name="line.467"></a>
<span class="sourceLineNo">468</span>    /**<a name="line.468"></a>
<span class="sourceLineNo">469</span>     * The paint used for the zero baseline against the domain axis.<a name="line.469"></a>
<span class="sourceLineNo">470</span>     *<a name="line.470"></a>
<span class="sourceLineNo">471</span>     * @since 1.0.5<a name="line.471"></a>
<span class="sourceLineNo">472</span>     */<a name="line.472"></a>
<span class="sourceLineNo">473</span>    private transient Paint domainZeroBaselinePaint;<a name="line.473"></a>
<span class="sourceLineNo">474</span><a name="line.474"></a>
<span class="sourceLineNo">475</span>    /**<a name="line.475"></a>
<span class="sourceLineNo">476</span>     * A flag that controls whether or not the zero baseline against the range<a name="line.476"></a>
<span class="sourceLineNo">477</span>     * axis is visible.<a name="line.477"></a>
<span class="sourceLineNo">478</span>     */<a name="line.478"></a>
<span class="sourceLineNo">479</span>    private boolean rangeZeroBaselineVisible;<a name="line.479"></a>
<span class="sourceLineNo">480</span><a name="line.480"></a>
<span class="sourceLineNo">481</span>    /** The stroke used for the zero baseline against the range axis. */<a name="line.481"></a>
<span class="sourceLineNo">482</span>    private transient Stroke rangeZeroBaselineStroke;<a name="line.482"></a>
<span class="sourceLineNo">483</span><a name="line.483"></a>
<span class="sourceLineNo">484</span>    /** The paint used for the zero baseline against the range axis. */<a name="line.484"></a>
<span class="sourceLineNo">485</span>    private transient Paint rangeZeroBaselinePaint;<a name="line.485"></a>
<span class="sourceLineNo">486</span><a name="line.486"></a>
<span class="sourceLineNo">487</span>    /** A flag that controls whether or not a domain crosshair is drawn..*/<a name="line.487"></a>
<span class="sourceLineNo">488</span>    private boolean domainCrosshairVisible;<a name="line.488"></a>
<span class="sourceLineNo">489</span><a name="line.489"></a>
<span class="sourceLineNo">490</span>    /** The domain crosshair value. */<a name="line.490"></a>
<span class="sourceLineNo">491</span>    private double domainCrosshairValue;<a name="line.491"></a>
<span class="sourceLineNo">492</span><a name="line.492"></a>
<span class="sourceLineNo">493</span>    /** The pen/brush used to draw the crosshair (if any). */<a name="line.493"></a>
<span class="sourceLineNo">494</span>    private transient Stroke domainCrosshairStroke;<a name="line.494"></a>
<span class="sourceLineNo">495</span><a name="line.495"></a>
<span class="sourceLineNo">496</span>    /** The color used to draw the crosshair (if any). */<a name="line.496"></a>
<span class="sourceLineNo">497</span>    private transient Paint domainCrosshairPaint;<a name="line.497"></a>
<span class="sourceLineNo">498</span><a name="line.498"></a>
<span class="sourceLineNo">499</span>    /**<a name="line.499"></a>
<span class="sourceLineNo">500</span>     * A flag that controls whether or not the crosshair locks onto actual<a name="line.500"></a>
<span class="sourceLineNo">501</span>     * data points.<a name="line.501"></a>
<span class="sourceLineNo">502</span>     */<a name="line.502"></a>
<span class="sourceLineNo">503</span>    private boolean domainCrosshairLockedOnData = true;<a name="line.503"></a>
<span class="sourceLineNo">504</span><a name="line.504"></a>
<span class="sourceLineNo">505</span>    /** A flag that controls whether or not a range crosshair is drawn..*/<a name="line.505"></a>
<span class="sourceLineNo">506</span>    private boolean rangeCrosshairVisible;<a name="line.506"></a>
<span class="sourceLineNo">507</span><a name="line.507"></a>
<span class="sourceLineNo">508</span>    /** The range crosshair value. */<a name="line.508"></a>
<span class="sourceLineNo">509</span>    private double rangeCrosshairValue;<a name="line.509"></a>
<span class="sourceLineNo">510</span><a name="line.510"></a>
<span class="sourceLineNo">511</span>    /** The pen/brush used to draw the crosshair (if any). */<a name="line.511"></a>
<span class="sourceLineNo">512</span>    private transient Stroke rangeCrosshairStroke;<a name="line.512"></a>
<span class="sourceLineNo">513</span><a name="line.513"></a>
<span class="sourceLineNo">514</span>    /** The color used to draw the crosshair (if any). */<a name="line.514"></a>
<span class="sourceLineNo">515</span>    private transient Paint rangeCrosshairPaint;<a name="line.515"></a>
<span class="sourceLineNo">516</span><a name="line.516"></a>
<span class="sourceLineNo">517</span>    /**<a name="line.517"></a>
<span class="sourceLineNo">518</span>     * A flag that controls whether or not the crosshair locks onto actual<a name="line.518"></a>
<span class="sourceLineNo">519</span>     * data points.<a name="line.519"></a>
<span class="sourceLineNo">520</span>     */<a name="line.520"></a>
<span class="sourceLineNo">521</span>    private boolean rangeCrosshairLockedOnData = true;<a name="line.521"></a>
<span class="sourceLineNo">522</span><a name="line.522"></a>
<span class="sourceLineNo">523</span>    /** A map of lists of foreground markers (optional) for the domain axes. */<a name="line.523"></a>
<span class="sourceLineNo">524</span>    private Map foregroundDomainMarkers;<a name="line.524"></a>
<span class="sourceLineNo">525</span><a name="line.525"></a>
<span class="sourceLineNo">526</span>    /** A map of lists of background markers (optional) for the domain axes. */<a name="line.526"></a>
<span class="sourceLineNo">527</span>    private Map backgroundDomainMarkers;<a name="line.527"></a>
<span class="sourceLineNo">528</span><a name="line.528"></a>
<span class="sourceLineNo">529</span>    /** A map of lists of foreground markers (optional) for the range axes. */<a name="line.529"></a>
<span class="sourceLineNo">530</span>    private Map foregroundRangeMarkers;<a name="line.530"></a>
<span class="sourceLineNo">531</span><a name="line.531"></a>
<span class="sourceLineNo">532</span>    /** A map of lists of background markers (optional) for the range axes. */<a name="line.532"></a>
<span class="sourceLineNo">533</span>    private Map backgroundRangeMarkers;<a name="line.533"></a>
<span class="sourceLineNo">534</span><a name="line.534"></a>
<span class="sourceLineNo">535</span>    /**<a name="line.535"></a>
<span class="sourceLineNo">536</span>     * A (possibly empty) list of annotations for the plot.  The list should<a name="line.536"></a>
<span class="sourceLineNo">537</span>     * be initialised in the constructor and never allowed to be<a name="line.537"></a>
<span class="sourceLineNo">538</span>     * &lt;code&gt;null&lt;/code&gt;.<a name="line.538"></a>
<span class="sourceLineNo">539</span>     */<a name="line.539"></a>
<span class="sourceLineNo">540</span>    private List annotations;<a name="line.540"></a>
<span class="sourceLineNo">541</span><a name="line.541"></a>
<span class="sourceLineNo">542</span>    /** The paint used for the domain tick bands (if any). */<a name="line.542"></a>
<span class="sourceLineNo">543</span>    private transient Paint domainTickBandPaint;<a name="line.543"></a>
<span class="sourceLineNo">544</span><a name="line.544"></a>
<span class="sourceLineNo">545</span>    /** The paint used for the range tick bands (if any). */<a name="line.545"></a>
<span class="sourceLineNo">546</span>    private transient Paint rangeTickBandPaint;<a name="line.546"></a>
<span class="sourceLineNo">547</span><a name="line.547"></a>
<span class="sourceLineNo">548</span>    /** The fixed domain axis space. */<a name="line.548"></a>
<span class="sourceLineNo">549</span>    private AxisSpace fixedDomainAxisSpace;<a name="line.549"></a>
<span class="sourceLineNo">550</span><a name="line.550"></a>
<span class="sourceLineNo">551</span>    /** The fixed range axis space. */<a name="line.551"></a>
<span class="sourceLineNo">552</span>    private AxisSpace fixedRangeAxisSpace;<a name="line.552"></a>
<span class="sourceLineNo">553</span><a name="line.553"></a>
<span class="sourceLineNo">554</span>    /**<a name="line.554"></a>
<span class="sourceLineNo">555</span>     * The order of the dataset rendering (REVERSE draws the primary dataset<a name="line.555"></a>
<span class="sourceLineNo">556</span>     * last so that it appears to be on top).<a name="line.556"></a>
<span class="sourceLineNo">557</span>     */<a name="line.557"></a>
<span class="sourceLineNo">558</span>    private DatasetRenderingOrder datasetRenderingOrder<a name="line.558"></a>
<span class="sourceLineNo">559</span>            = DatasetRenderingOrder.REVERSE;<a name="line.559"></a>
<span class="sourceLineNo">560</span><a name="line.560"></a>
<span class="sourceLineNo">561</span>    /**<a name="line.561"></a>
<span class="sourceLineNo">562</span>     * The order of the series rendering (REVERSE draws the primary series<a name="line.562"></a>
<span class="sourceLineNo">563</span>     * last so that it appears to be on top).<a name="line.563"></a>
<span class="sourceLineNo">564</span>     */<a name="line.564"></a>
<span class="sourceLineNo">565</span>    private SeriesRenderingOrder seriesRenderingOrder<a name="line.565"></a>
<span class="sourceLineNo">566</span>            = SeriesRenderingOrder.REVERSE;<a name="line.566"></a>
<span class="sourceLineNo">567</span><a name="line.567"></a>
<span class="sourceLineNo">568</span>    /**<a name="line.568"></a>
<span class="sourceLineNo">569</span>     * The weight for this plot (only relevant if this is a subplot in a<a name="line.569"></a>
<span class="sourceLineNo">570</span>     * combined plot).<a name="line.570"></a>
<span class="sourceLineNo">571</span>     */<a name="line.571"></a>
<span class="sourceLineNo">572</span>    private int weight;<a name="line.572"></a>
<span class="sourceLineNo">573</span><a name="line.573"></a>
<span class="sourceLineNo">574</span>    /**<a name="line.574"></a>
<span class="sourceLineNo">575</span>     * An optional collection of legend items that can be returned by the<a name="line.575"></a>
<span class="sourceLineNo">576</span>     * getLegendItems() method.<a name="line.576"></a>
<span class="sourceLineNo">577</span>     */<a name="line.577"></a>
<span class="sourceLineNo">578</span>    private LegendItemCollection fixedLegendItems;<a name="line.578"></a>
<span class="sourceLineNo">579</span><a name="line.579"></a>
<span class="sourceLineNo">580</span>    /**<a name="line.580"></a>
<span class="sourceLineNo">581</span>     * A flag that controls whether or not panning is enabled for the domain<a name="line.581"></a>
<span class="sourceLineNo">582</span>     * axis/axes.<a name="line.582"></a>
<span class="sourceLineNo">583</span>     *<a name="line.583"></a>
<span class="sourceLineNo">584</span>     * @since 1.0.13<a name="line.584"></a>
<span class="sourceLineNo">585</span>     */<a name="line.585"></a>
<span class="sourceLineNo">586</span>    private boolean domainPannable;<a name="line.586"></a>
<span class="sourceLineNo">587</span><a name="line.587"></a>
<span class="sourceLineNo">588</span>    /**<a name="line.588"></a>
<span class="sourceLineNo">589</span>     * A flag that controls whether or not panning is enabled for the range<a name="line.589"></a>
<span class="sourceLineNo">590</span>     * axis/axes.<a name="line.590"></a>
<span class="sourceLineNo">591</span>     *<a name="line.591"></a>
<span class="sourceLineNo">592</span>     * @since 1.0.13<a name="line.592"></a>
<span class="sourceLineNo">593</span>     */<a name="line.593"></a>
<span class="sourceLineNo">594</span>    private boolean rangePannable;<a name="line.594"></a>
<span class="sourceLineNo">595</span><a name="line.595"></a>
<span class="sourceLineNo">596</span>    /**<a name="line.596"></a>
<span class="sourceLineNo">597</span>     * The shadow generator (&lt;code&gt;null&lt;/code&gt; permitted).<a name="line.597"></a>
<span class="sourceLineNo">598</span>     * <a name="line.598"></a>
<span class="sourceLineNo">599</span>     * @since 1.0.14<a name="line.599"></a>
<span class="sourceLineNo">600</span>     */<a name="line.600"></a>
<span class="sourceLineNo">601</span>    private ShadowGenerator shadowGenerator;<a name="line.601"></a>
<span class="sourceLineNo">602</span>    <a name="line.602"></a>
<span class="sourceLineNo">603</span>    /**<a name="line.603"></a>
<span class="sourceLineNo">604</span>     * Creates a new &lt;code&gt;XYPlot&lt;/code&gt; instance with no dataset, no axes and<a name="line.604"></a>
<span class="sourceLineNo">605</span>     * no renderer.  You should specify these items before using the plot.<a name="line.605"></a>
<span class="sourceLineNo">606</span>     */<a name="line.606"></a>
<span class="sourceLineNo">607</span>    public XYPlot() {<a name="line.607"></a>
<span class="sourceLineNo">608</span>        this(null, null, null, null);<a name="line.608"></a>
<span class="sourceLineNo">609</span>    }<a name="line.609"></a>
<span class="sourceLineNo">610</span><a name="line.610"></a>
<span class="sourceLineNo">611</span>    /**<a name="line.611"></a>
<span class="sourceLineNo">612</span>     * Creates a new plot with the specified dataset, axes and renderer.  Any<a name="line.612"></a>
<span class="sourceLineNo">613</span>     * of the arguments can be &lt;code&gt;null&lt;/code&gt;, but in that case you should<a name="line.613"></a>
<span class="sourceLineNo">614</span>     * take care to specify the value before using the plot (otherwise a<a name="line.614"></a>
<span class="sourceLineNo">615</span>     * &lt;code&gt;NullPointerException&lt;/code&gt; may be thrown).<a name="line.615"></a>
<span class="sourceLineNo">616</span>     *<a name="line.616"></a>
<span class="sourceLineNo">617</span>     * @param dataset  the dataset (&lt;code&gt;null&lt;/code&gt; permitted).<a name="line.617"></a>
<span class="sourceLineNo">618</span>     * @param domainAxis  the domain axis (&lt;code&gt;null&lt;/code&gt; permitted).<a name="line.618"></a>
<span class="sourceLineNo">619</span>     * @param rangeAxis  the range axis (&lt;code&gt;null&lt;/code&gt; permitted).<a name="line.619"></a>
<span class="sourceLineNo">620</span>     * @param renderer  the renderer (&lt;code&gt;null&lt;/code&gt; permitted).<a name="line.620"></a>
<span class="sourceLineNo">621</span>     */<a name="line.621"></a>
<span class="sourceLineNo">622</span>    public XYPlot(XYDataset dataset,<a name="line.622"></a>
<span class="sourceLineNo">623</span>                  ValueAxis domainAxis,<a name="line.623"></a>
<span class="sourceLineNo">624</span>                  ValueAxis rangeAxis,<a name="line.624"></a>
<span class="sourceLineNo">625</span>                  XYItemRenderer renderer) {<a name="line.625"></a>
<span class="sourceLineNo">626</span><a name="line.626"></a>
<span class="sourceLineNo">627</span>        super();<a name="line.627"></a>
<span class="sourceLineNo">628</span><a name="line.628"></a>
<span class="sourceLineNo">629</span>        this.orientation = PlotOrientation.VERTICAL;<a name="line.629"></a>
<span class="sourceLineNo">630</span>        this.weight = 1;  // only relevant when this is a subplot<a name="line.630"></a>
<span class="sourceLineNo">631</span>        this.axisOffset = RectangleInsets.ZERO_INSETS;<a name="line.631"></a>
<span class="sourceLineNo">632</span><a name="line.632"></a>
<span class="sourceLineNo">633</span>        // allocate storage for datasets, axes and renderers (all optional)<a name="line.633"></a>
<span class="sourceLineNo">634</span>        this.domainAxes = new ObjectList();<a name="line.634"></a>
<span class="sourceLineNo">635</span>        this.domainAxisLocations = new ObjectList();<a name="line.635"></a>
<span class="sourceLineNo">636</span>        this.foregroundDomainMarkers = new HashMap();<a name="line.636"></a>
<span class="sourceLineNo">637</span>        this.backgroundDomainMarkers = new HashMap();<a name="line.637"></a>
<span class="sourceLineNo">638</span><a name="line.638"></a>
<span class="sourceLineNo">639</span>        this.rangeAxes = new ObjectList();<a name="line.639"></a>
<span class="sourceLineNo">640</span>        this.rangeAxisLocations = new ObjectList();<a name="line.640"></a>
<span class="sourceLineNo">641</span>        this.foregroundRangeMarkers = new HashMap();<a name="line.641"></a>
<span class="sourceLineNo">642</span>        this.backgroundRangeMarkers = new HashMap();<a name="line.642"></a>
<span class="sourceLineNo">643</span><a name="line.643"></a>
<span class="sourceLineNo">644</span>        this.datasets = new ObjectList();<a name="line.644"></a>
<span class="sourceLineNo">645</span>        this.renderers = new ObjectList();<a name="line.645"></a>
<span class="sourceLineNo">646</span><a name="line.646"></a>
<span class="sourceLineNo">647</span>        this.datasetToDomainAxesMap = new TreeMap();<a name="line.647"></a>
<span class="sourceLineNo">648</span>        this.datasetToRangeAxesMap = new TreeMap();<a name="line.648"></a>
<span class="sourceLineNo">649</span><a name="line.649"></a>
<span class="sourceLineNo">650</span>        this.annotations = new java.util.ArrayList();<a name="line.650"></a>
<span class="sourceLineNo">651</span><a name="line.651"></a>
<span class="sourceLineNo">652</span>        this.datasets.set(0, dataset);<a name="line.652"></a>
<span class="sourceLineNo">653</span>        if (dataset != null) {<a name="line.653"></a>
<span class="sourceLineNo">654</span>            dataset.addChangeListener(this);<a name="line.654"></a>
<span class="sourceLineNo">655</span>        }<a name="line.655"></a>
<span class="sourceLineNo">656</span><a name="line.656"></a>
<span class="sourceLineNo">657</span>        this.renderers.set(0, renderer);<a name="line.657"></a>
<span class="sourceLineNo">658</span>        if (renderer != null) {<a name="line.658"></a>
<span class="sourceLineNo">659</span>            renderer.setPlot(this);<a name="line.659"></a>
<span class="sourceLineNo">660</span>            renderer.addChangeListener(this);<a name="line.660"></a>
<span class="sourceLineNo">661</span>        }<a name="line.661"></a>
<span class="sourceLineNo">662</span><a name="line.662"></a>
<span class="sourceLineNo">663</span>        this.domainAxes.set(0, domainAxis);<a name="line.663"></a>
<span class="sourceLineNo">664</span>        this.mapDatasetToDomainAxis(0, 0);<a name="line.664"></a>
<span class="sourceLineNo">665</span>        if (domainAxis != null) {<a name="line.665"></a>
<span class="sourceLineNo">666</span>            domainAxis.setPlot(this);<a name="line.666"></a>
<span class="sourceLineNo">667</span>            domainAxis.addChangeListener(this);<a name="line.667"></a>
<span class="sourceLineNo">668</span>        }<a name="line.668"></a>
<span class="sourceLineNo">669</span>        this.domainAxisLocations.set(0, AxisLocation.BOTTOM_OR_LEFT);<a name="line.669"></a>
<span class="sourceLineNo">670</span><a name="line.670"></a>
<span class="sourceLineNo">671</span>        this.rangeAxes.set(0, rangeAxis);<a name="line.671"></a>
<span class="sourceLineNo">672</span>        this.mapDatasetToRangeAxis(0, 0);<a name="line.672"></a>
<span class="sourceLineNo">673</span>        if (rangeAxis != null) {<a name="line.673"></a>
<span class="sourceLineNo">674</span>            rangeAxis.setPlot(this);<a name="line.674"></a>
<span class="sourceLineNo">675</span>            rangeAxis.addChangeListener(this);<a name="line.675"></a>
<span class="sourceLineNo">676</span>        }<a name="line.676"></a>
<span class="sourceLineNo">677</span>        this.rangeAxisLocations.set(0, AxisLocation.BOTTOM_OR_LEFT);<a name="line.677"></a>
<span class="sourceLineNo">678</span><a name="line.678"></a>
<span class="sourceLineNo">679</span>        configureDomainAxes();<a name="line.679"></a>
<span class="sourceLineNo">680</span>        configureRangeAxes();<a name="line.680"></a>
<span class="sourceLineNo">681</span><a name="line.681"></a>
<span class="sourceLineNo">682</span>        this.domainGridlinesVisible = true;<a name="line.682"></a>
<span class="sourceLineNo">683</span>        this.domainGridlineStroke = DEFAULT_GRIDLINE_STROKE;<a name="line.683"></a>
<span class="sourceLineNo">684</span>        this.domainGridlinePaint = DEFAULT_GRIDLINE_PAINT;<a name="line.684"></a>
<span class="sourceLineNo">685</span><a name="line.685"></a>
<span class="sourceLineNo">686</span>        this.domainMinorGridlinesVisible = false;<a name="line.686"></a>
<span class="sourceLineNo">687</span>        this.domainMinorGridlineStroke = DEFAULT_GRIDLINE_STROKE;<a name="line.687"></a>
<span class="sourceLineNo">688</span>        this.domainMinorGridlinePaint = Color.white;<a name="line.688"></a>
<span class="sourceLineNo">689</span><a name="line.689"></a>
<span class="sourceLineNo">690</span>        this.domainZeroBaselineVisible = false;<a name="line.690"></a>
<span class="sourceLineNo">691</span>        this.domainZeroBaselinePaint = Color.black;<a name="line.691"></a>
<span class="sourceLineNo">692</span>        this.domainZeroBaselineStroke = new BasicStroke(0.5f);<a name="line.692"></a>
<span class="sourceLineNo">693</span><a name="line.693"></a>
<span class="sourceLineNo">694</span>        this.rangeGridlinesVisible = true;<a name="line.694"></a>
<span class="sourceLineNo">695</span>        this.rangeGridlineStroke = DEFAULT_GRIDLINE_STROKE;<a name="line.695"></a>
<span class="sourceLineNo">696</span>        this.rangeGridlinePaint = DEFAULT_GRIDLINE_PAINT;<a name="line.696"></a>
<span class="sourceLineNo">697</span><a name="line.697"></a>
<span class="sourceLineNo">698</span>        this.rangeMinorGridlinesVisible = false;<a name="line.698"></a>
<span class="sourceLineNo">699</span>        this.rangeMinorGridlineStroke = DEFAULT_GRIDLINE_STROKE;<a name="line.699"></a>
<span class="sourceLineNo">700</span>        this.rangeMinorGridlinePaint = Color.white;<a name="line.700"></a>
<span class="sourceLineNo">701</span><a name="line.701"></a>
<span class="sourceLineNo">702</span>        this.rangeZeroBaselineVisible = false;<a name="line.702"></a>
<span class="sourceLineNo">703</span>        this.rangeZeroBaselinePaint = Color.black;<a name="line.703"></a>
<span class="sourceLineNo">704</span>        this.rangeZeroBaselineStroke = new BasicStroke(0.5f);<a name="line.704"></a>
<span class="sourceLineNo">705</span><a name="line.705"></a>
<span class="sourceLineNo">706</span>        this.domainCrosshairVisible = false;<a name="line.706"></a>
<span class="sourceLineNo">707</span>        this.domainCrosshairValue = 0.0;<a name="line.707"></a>
<span class="sourceLineNo">708</span>        this.domainCrosshairStroke = DEFAULT_CROSSHAIR_STROKE;<a name="line.708"></a>
<span class="sourceLineNo">709</span>        this.domainCrosshairPaint = DEFAULT_CROSSHAIR_PAINT;<a name="line.709"></a>
<span class="sourceLineNo">710</span><a name="line.710"></a>
<span class="sourceLineNo">711</span>        this.rangeCrosshairVisible = false;<a name="line.711"></a>
<span class="sourceLineNo">712</span>        this.rangeCrosshairValue = 0.0;<a name="line.712"></a>
<span class="sourceLineNo">713</span>        this.rangeCrosshairStroke = DEFAULT_CROSSHAIR_STROKE;<a name="line.713"></a>
<span class="sourceLineNo">714</span>        this.rangeCrosshairPaint = DEFAULT_CROSSHAIR_PAINT;<a name="line.714"></a>
<span class="sourceLineNo">715</span>        this.shadowGenerator = null;<a name="line.715"></a>
<span class="sourceLineNo">716</span>    }<a name="line.716"></a>
<span class="sourceLineNo">717</span><a name="line.717"></a>
<span class="sourceLineNo">718</span>    /**<a name="line.718"></a>
<span class="sourceLineNo">719</span>     * Returns the plot type as a string.<a name="line.719"></a>
<span class="sourceLineNo">720</span>     *<a name="line.720"></a>
<span class="sourceLineNo">721</span>     * @return A short string describing the type of plot.<a name="line.721"></a>
<span class="sourceLineNo">722</span>     */<a name="line.722"></a>
<span class="sourceLineNo">723</span>    public String getPlotType() {<a name="line.723"></a>
<span class="sourceLineNo">724</span>        return localizationResources.getString("XY_Plot");<a name="line.724"></a>
<span class="sourceLineNo">725</span>    }<a name="line.725"></a>
<span class="sourceLineNo">726</span><a name="line.726"></a>
<span class="sourceLineNo">727</span>    /**<a name="line.727"></a>
<span class="sourceLineNo">728</span>     * Returns the orientation of the plot.<a name="line.728"></a>
<span class="sourceLineNo">729</span>     *<a name="line.729"></a>
<span class="sourceLineNo">730</span>     * @return The orientation (never &lt;code&gt;null&lt;/code&gt;).<a name="line.730"></a>
<span class="sourceLineNo">731</span>     *<a name="line.731"></a>
<span class="sourceLineNo">732</span>     * @see #setOrientation(PlotOrientation)<a name="line.732"></a>
<span class="sourceLineNo">733</span>     */<a name="line.733"></a>
<span class="sourceLineNo">734</span>    public PlotOrientation getOrientation() {<a name="line.734"></a>
<span class="sourceLineNo">735</span>        return this.orientation;<a name="line.735"></a>
<span class="sourceLineNo">736</span>    }<a name="line.736"></a>
<span class="sourceLineNo">737</span><a name="line.737"></a>
<span class="sourceLineNo">738</span>    /**<a name="line.738"></a>
<span class="sourceLineNo">739</span>     * Sets the orientation for the plot and sends a {@link PlotChangeEvent} to<a name="line.739"></a>
<span class="sourceLineNo">740</span>     * all registered listeners.<a name="line.740"></a>
<span class="sourceLineNo">741</span>     *<a name="line.741"></a>
<span class="sourceLineNo">742</span>     * @param orientation  the orientation (&lt;code&gt;null&lt;/code&gt; not allowed).<a name="line.742"></a>
<span class="sourceLineNo">743</span>     *<a name="line.743"></a>
<span class="sourceLineNo">744</span>     * @see #getOrientation()<a name="line.744"></a>
<span class="sourceLineNo">745</span>     */<a name="line.745"></a>
<span class="sourceLineNo">746</span>    public void setOrientation(PlotOrientation orientation) {<a name="line.746"></a>
<span class="sourceLineNo">747</span>        if (orientation == null) {<a name="line.747"></a>
<span class="sourceLineNo">748</span>            throw new IllegalArgumentException("Null 'orientation' argument.");<a name="line.748"></a>
<span class="sourceLineNo">749</span>        }<a name="line.749"></a>
<span class="sourceLineNo">750</span>        if (orientation != this.orientation) {<a name="line.750"></a>
<span class="sourceLineNo">751</span>            this.orientation = orientation;<a name="line.751"></a>
<span class="sourceLineNo">752</span>            fireChangeEvent();<a name="line.752"></a>
<span class="sourceLineNo">753</span>        }<a name="line.753"></a>
<span class="sourceLineNo">754</span>    }<a name="line.754"></a>
<span class="sourceLineNo">755</span><a name="line.755"></a>
<span class="sourceLineNo">756</span>    /**<a name="line.756"></a>
<span class="sourceLineNo">757</span>     * Returns the axis offset.<a name="line.757"></a>
<span class="sourceLineNo">758</span>     *<a name="line.758"></a>
<span class="sourceLineNo">759</span>     * @return The axis offset (never &lt;code&gt;null&lt;/code&gt;).<a name="line.759"></a>
<span class="sourceLineNo">760</span>     *<a name="line.760"></a>
<span class="sourceLineNo">761</span>     * @see #setAxisOffset(RectangleInsets)<a name="line.761"></a>
<span class="sourceLineNo">762</span>     */<a name="line.762"></a>
<span class="sourceLineNo">763</span>    public RectangleInsets getAxisOffset() {<a name="line.763"></a>
<span class="sourceLineNo">764</span>        return this.axisOffset;<a name="line.764"></a>
<span class="sourceLineNo">765</span>    }<a name="line.765"></a>
<span class="sourceLineNo">766</span><a name="line.766"></a>
<span class="sourceLineNo">767</span>    /**<a name="line.767"></a>
<span class="sourceLineNo">768</span>     * Sets the axis offsets (gap between the data area and the axes) and sends<a name="line.768"></a>
<span class="sourceLineNo">769</span>     * a {@link PlotChangeEvent} to all registered listeners.<a name="line.769"></a>
<span class="sourceLineNo">770</span>     *<a name="line.770"></a>
<span class="sourceLineNo">771</span>     * @param offset  the offset (&lt;code&gt;null&lt;/code&gt; not permitted).<a name="line.771"></a>
<span class="sourceLineNo">772</span>     *<a name="line.772"></a>
<span class="sourceLineNo">773</span>     * @see #getAxisOffset()<a name="line.773"></a>
<span class="sourceLineNo">774</span>     */<a name="line.774"></a>
<span class="sourceLineNo">775</span>    public void setAxisOffset(RectangleInsets offset) {<a name="line.775"></a>
<span class="sourceLineNo">776</span>        if (offset == null) {<a name="line.776"></a>
<span class="sourceLineNo">777</span>            throw new IllegalArgumentException("Null 'offset' argument.");<a name="line.777"></a>
<span class="sourceLineNo">778</span>        }<a name="line.778"></a>
<span class="sourceLineNo">779</span>        this.axisOffset = offset;<a name="line.779"></a>
<span class="sourceLineNo">780</span>        fireChangeEvent();<a name="line.780"></a>
<span class="sourceLineNo">781</span>    }<a name="line.781"></a>
<span class="sourceLineNo">782</span><a name="line.782"></a>
<span class="sourceLineNo">783</span>    /**<a name="line.783"></a>
<span class="sourceLineNo">784</span>     * Returns the domain axis with index 0.  If the domain axis for this plot<a name="line.784"></a>
<span class="sourceLineNo">785</span>     * is &lt;code&gt;null&lt;/code&gt;, then the method will return the parent plot's<a name="line.785"></a>
<span class="sourceLineNo">786</span>     * domain axis (if there is a parent plot).<a name="line.786"></a>
<span class="sourceLineNo">787</span>     *<a name="line.787"></a>
<span class="sourceLineNo">788</span>     * @return The domain axis (possibly &lt;code&gt;null&lt;/code&gt;).<a name="line.788"></a>
<span class="sourceLineNo">789</span>     *<a name="line.789"></a>
<span class="sourceLineNo">790</span>     * @see #getDomainAxis(int)<a name="line.790"></a>
<span class="sourceLineNo">791</span>     * @see #setDomainAxis(ValueAxis)<a name="line.791"></a>
<span class="sourceLineNo">792</span>     */<a name="line.792"></a>
<span class="sourceLineNo">793</span>    public ValueAxis getDomainAxis() {<a name="line.793"></a>
<span class="sourceLineNo">794</span>        return getDomainAxis(0);<a name="line.794"></a>
<span class="sourceLineNo">795</span>    }<a name="line.795"></a>
<span class="sourceLineNo">796</span><a name="line.796"></a>
<span class="sourceLineNo">797</span>    /**<a name="line.797"></a>
<span class="sourceLineNo">798</span>     * Returns the domain axis with the specified index, or &lt;code&gt;null&lt;/code&gt;.<a name="line.798"></a>
<span class="sourceLineNo">799</span>     *<a name="line.799"></a>
<span class="sourceLineNo">800</span>     * @param index  the axis index.<a name="line.800"></a>
<span class="sourceLineNo">801</span>     *<a name="line.801"></a>
<span class="sourceLineNo">802</span>     * @return The axis (&lt;code&gt;null&lt;/code&gt; possible).<a name="line.802"></a>
<span class="sourceLineNo">803</span>     *<a name="line.803"></a>
<span class="sourceLineNo">804</span>     * @see #setDomainAxis(int, ValueAxis)<a name="line.804"></a>
<span class="sourceLineNo">805</span>     */<a name="line.805"></a>
<span class="sourceLineNo">806</span>    public ValueAxis getDomainAxis(int index) {<a name="line.806"></a>
<span class="sourceLineNo">807</span>        ValueAxis result = null;<a name="line.807"></a>
<span class="sourceLineNo">808</span>        if (index &lt; this.domainAxes.size()) {<a name="line.808"></a>
<span class="sourceLineNo">809</span>            result = (ValueAxis) this.domainAxes.get(index);<a name="line.809"></a>
<span class="sourceLineNo">810</span>        }<a name="line.810"></a>
<span class="sourceLineNo">811</span>        if (result == null) {<a name="line.811"></a>
<span class="sourceLineNo">812</span>            Plot parent = getParent();<a name="line.812"></a>
<span class="sourceLineNo">813</span>            if (parent instanceof XYPlot) {<a name="line.813"></a>
<span class="sourceLineNo">814</span>                XYPlot xy = (XYPlot) parent;<a name="line.814"></a>
<span class="sourceLineNo">815</span>                result = xy.getDomainAxis(index);<a name="line.815"></a>
<span class="sourceLineNo">816</span>            }<a name="line.816"></a>
<span class="sourceLineNo">817</span>        }<a name="line.817"></a>
<span class="sourceLineNo">818</span>        return result;<a name="line.818"></a>
<span class="sourceLineNo">819</span>    }<a name="line.819"></a>
<span class="sourceLineNo">820</span><a name="line.820"></a>
<span class="sourceLineNo">821</span>    /**<a name="line.821"></a>
<span class="sourceLineNo">822</span>     * Sets the domain axis for the plot and sends a {@link PlotChangeEvent}<a name="line.822"></a>
<span class="sourceLineNo">823</span>     * to all registered listeners.<a name="line.823"></a>
<span class="sourceLineNo">824</span>     *<a name="line.824"></a>
<span class="sourceLineNo">825</span>     * @param axis  the new axis (&lt;code&gt;null&lt;/code&gt; permitted).<a name="line.825"></a>
<span class="sourceLineNo">826</span>     *<a name="line.826"></a>
<span class="sourceLineNo">827</span>     * @see #getDomainAxis()<a name="line.827"></a>
<span class="sourceLineNo">828</span>     * @see #setDomainAxis(int, ValueAxis)<a name="line.828"></a>
<span class="sourceLineNo">829</span>     */<a name="line.829"></a>
<span class="sourceLineNo">830</span>    public void setDomainAxis(ValueAxis axis) {<a name="line.830"></a>
<span class="sourceLineNo">831</span>        setDomainAxis(0, axis);<a name="line.831"></a>
<span class="sourceLineNo">832</span>    }<a name="line.832"></a>
<span class="sourceLineNo">833</span><a name="line.833"></a>
<span class="sourceLineNo">834</span>    /**<a name="line.834"></a>
<span class="sourceLineNo">835</span>     * Sets a domain axis and sends a {@link PlotChangeEvent} to all<a name="line.835"></a>
<span class="sourceLineNo">836</span>     * registered listeners.<a name="line.836"></a>
<span class="sourceLineNo">837</span>     *<a name="line.837"></a>
<span class="sourceLineNo">838</span>     * @param index  the axis index.<a name="line.838"></a>
<span class="sourceLineNo">839</span>     * @param axis  the axis (&lt;code&gt;null&lt;/code&gt; permitted).<a name="line.839"></a>
<span class="sourceLineNo">840</span>     *<a name="line.840"></a>
<span class="sourceLineNo">841</span>     * @see #getDomainAxis(int)<a name="line.841"></a>
<span class="sourceLineNo">842</span>     * @see #setRangeAxis(int, ValueAxis)<a name="line.842"></a>
<span class="sourceLineNo">843</span>     */<a name="line.843"></a>
<span class="sourceLineNo">844</span>    public void setDomainAxis(int index, ValueAxis axis) {<a name="line.844"></a>
<span class="sourceLineNo">845</span>        setDomainAxis(index, axis, true);<a name="line.845"></a>
<span class="sourceLineNo">846</span>    }<a name="line.846"></a>
<span class="sourceLineNo">847</span><a name="line.847"></a>
<span class="sourceLineNo">848</span>    /**<a name="line.848"></a>
<span class="sourceLineNo">849</span>     * Sets a domain axis and, if requested, sends a {@link PlotChangeEvent} to<a name="line.849"></a>
<span class="sourceLineNo">850</span>     * all registered listeners.<a name="line.850"></a>
<span class="sourceLineNo">851</span>     *<a name="line.851"></a>
<span class="sourceLineNo">852</span>     * @param index  the axis index.<a name="line.852"></a>
<span class="sourceLineNo">853</span>     * @param axis  the axis.<a name="line.853"></a>
<span class="sourceLineNo">854</span>     * @param notify  notify listeners?<a name="line.854"></a>
<span class="sourceLineNo">855</span>     *<a name="line.855"></a>
<span class="sourceLineNo">856</span>     * @see #getDomainAxis(int)<a name="line.856"></a>
<span class="sourceLineNo">857</span>     */<a name="line.857"></a>
<span class="sourceLineNo">858</span>    public void setDomainAxis(int index, ValueAxis axis, boolean notify) {<a name="line.858"></a>
<span class="sourceLineNo">859</span>        ValueAxis existing = getDomainAxis(index);<a name="line.859"></a>
<span class="sourceLineNo">860</span>        if (existing != null) {<a name="line.860"></a>
<span class="sourceLineNo">861</span>            existing.removeChangeListener(this);<a name="line.861"></a>
<span class="sourceLineNo">862</span>        }<a name="line.862"></a>
<span class="sourceLineNo">863</span>        if (axis != null) {<a name="line.863"></a>
<span class="sourceLineNo">864</span>            axis.setPlot(this);<a name="line.864"></a>
<span class="sourceLineNo">865</span>        }<a name="line.865"></a>
<span class="sourceLineNo">866</span>        this.domainAxes.set(index, axis);<a name="line.866"></a>
<span class="sourceLineNo">867</span>        if (axis != null) {<a name="line.867"></a>
<span class="sourceLineNo">868</span>            axis.configure();<a name="line.868"></a>
<span class="sourceLineNo">869</span>            axis.addChangeListener(this);<a name="line.869"></a>
<span class="sourceLineNo">870</span>        }<a name="line.870"></a>
<span class="sourceLineNo">871</span>        if (notify) {<a name="line.871"></a>
<span class="sourceLineNo">872</span>            fireChangeEvent();<a name="line.872"></a>
<span class="sourceLineNo">873</span>        }<a name="line.873"></a>
<span class="sourceLineNo">874</span>    }<a name="line.874"></a>
<span class="sourceLineNo">875</span><a name="line.875"></a>
<span class="sourceLineNo">876</span>    /**<a name="line.876"></a>
<span class="sourceLineNo">877</span>     * Sets the domain axes for this plot and sends a {@link PlotChangeEvent}<a name="line.877"></a>
<span class="sourceLineNo">878</span>     * to all registered listeners.<a name="line.878"></a>
<span class="sourceLineNo">879</span>     *<a name="line.879"></a>
<span class="sourceLineNo">880</span>     * @param axes  the axes (&lt;code&gt;null&lt;/code&gt; not permitted).<a name="line.880"></a>
<span class="sourceLineNo">881</span>     *<a name="line.881"></a>
<span class="sourceLineNo">882</span>     * @see #setRangeAxes(ValueAxis[])<a name="line.882"></a>
<span class="sourceLineNo">883</span>     */<a name="line.883"></a>
<span class="sourceLineNo">884</span>    public void setDomainAxes(ValueAxis[] axes) {<a name="line.884"></a>
<span class="sourceLineNo">885</span>        for (int i = 0; i &lt; axes.length; i++) {<a name="line.885"></a>
<span class="sourceLineNo">886</span>            setDomainAxis(i, axes[i], false);<a name="line.886"></a>
<span class="sourceLineNo">887</span>        }<a name="line.887"></a>
<span class="sourceLineNo">888</span>        fireChangeEvent();<a name="line.888"></a>
<span class="sourceLineNo">889</span>    }<a name="line.889"></a>
<span class="sourceLineNo">890</span><a name="line.890"></a>
<span class="sourceLineNo">891</span>    /**<a name="line.891"></a>
<span class="sourceLineNo">892</span>     * Returns the location of the primary domain axis.<a name="line.892"></a>
<span class="sourceLineNo">893</span>     *<a name="line.893"></a>
<span class="sourceLineNo">894</span>     * @return The location (never &lt;code&gt;null&lt;/code&gt;).<a name="line.894"></a>
<span class="sourceLineNo">895</span>     *<a name="line.895"></a>
<span class="sourceLineNo">896</span>     * @see #setDomainAxisLocation(AxisLocation)<a name="line.896"></a>
<span class="sourceLineNo">897</span>     */<a name="line.897"></a>
<span class="sourceLineNo">898</span>    public AxisLocation getDomainAxisLocation() {<a name="line.898"></a>
<span class="sourceLineNo">899</span>        return (AxisLocation) this.domainAxisLocations.get(0);<a name="line.899"></a>
<span class="sourceLineNo">900</span>    }<a name="line.900"></a>
<span class="sourceLineNo">901</span><a name="line.901"></a>
<span class="sourceLineNo">902</span>    /**<a name="line.902"></a>
<span class="sourceLineNo">903</span>     * Sets the location of the primary domain axis and sends a<a name="line.903"></a>
<span class="sourceLineNo">904</span>     * {@link PlotChangeEvent} to all registered listeners.<a name="line.904"></a>
<span class="sourceLineNo">905</span>     *<a name="line.905"></a>
<span class="sourceLineNo">906</span>     * @param location  the location (&lt;code&gt;null&lt;/code&gt; not permitted).<a name="line.906"></a>
<span class="sourceLineNo">907</span>     *<a name="line.907"></a>
<span class="sourceLineNo">908</span>     * @see #getDomainAxisLocation()<a name="line.908"></a>
<span class="sourceLineNo">909</span>     */<a name="line.909"></a>
<span class="sourceLineNo">910</span>    public void setDomainAxisLocation(AxisLocation location) {<a name="line.910"></a>
<span class="sourceLineNo">911</span>        // delegate...<a name="line.911"></a>
<span class="sourceLineNo">912</span>        setDomainAxisLocation(0, location, true);<a name="line.912"></a>
<span class="sourceLineNo">913</span>    }<a name="line.913"></a>
<span class="sourceLineNo">914</span><a name="line.914"></a>
<span class="sourceLineNo">915</span>    /**<a name="line.915"></a>
<span class="sourceLineNo">916</span>     * Sets the location of the domain axis and, if requested, sends a<a name="line.916"></a>
<span class="sourceLineNo">917</span>     * {@link PlotChangeEvent} to all registered listeners.<a name="line.917"></a>
<span class="sourceLineNo">918</span>     *<a name="line.918"></a>
<span class="sourceLineNo">919</span>     * @param location  the location (&lt;code&gt;null&lt;/code&gt; not permitted).<a name="line.919"></a>
<span class="sourceLineNo">920</span>     * @param notify  notify listeners?<a name="line.920"></a>
<span class="sourceLineNo">921</span>     *<a name="line.921"></a>
<span class="sourceLineNo">922</span>     * @see #getDomainAxisLocation()<a name="line.922"></a>
<span class="sourceLineNo">923</span>     */<a name="line.923"></a>
<span class="sourceLineNo">924</span>    public void setDomainAxisLocation(AxisLocation location, boolean notify) {<a name="line.924"></a>
<span class="sourceLineNo">925</span>        // delegate...<a name="line.925"></a>
<span class="sourceLineNo">926</span>        setDomainAxisLocation(0, location, notify);<a name="line.926"></a>
<span class="sourceLineNo">927</span>    }<a name="line.927"></a>
<span class="sourceLineNo">928</span><a name="line.928"></a>
<span class="sourceLineNo">929</span>    /**<a name="line.929"></a>
<span class="sourceLineNo">930</span>     * Returns the edge for the primary domain axis (taking into account the<a name="line.930"></a>
<span class="sourceLineNo">931</span>     * plot's orientation).<a name="line.931"></a>
<span class="sourceLineNo">932</span>     *<a name="line.932"></a>
<span class="sourceLineNo">933</span>     * @return The edge.<a name="line.933"></a>
<span class="sourceLineNo">934</span>     *<a name="line.934"></a>
<span class="sourceLineNo">935</span>     * @see #getDomainAxisLocation()<a name="line.935"></a>
<span class="sourceLineNo">936</span>     * @see #getOrientation()<a name="line.936"></a>
<span class="sourceLineNo">937</span>     */<a name="line.937"></a>
<span class="sourceLineNo">938</span>    public RectangleEdge getDomainAxisEdge() {<a name="line.938"></a>
<span class="sourceLineNo">939</span>        return Plot.resolveDomainAxisLocation(getDomainAxisLocation(),<a name="line.939"></a>
<span class="sourceLineNo">940</span>                this.orientation);<a name="line.940"></a>
<span class="sourceLineNo">941</span>    }<a name="line.941"></a>
<span class="sourceLineNo">942</span><a name="line.942"></a>
<span class="sourceLineNo">943</span>    /**<a name="line.943"></a>
<span class="sourceLineNo">944</span>     * Returns the number of domain axes.<a name="line.944"></a>
<span class="sourceLineNo">945</span>     *<a name="line.945"></a>
<span class="sourceLineNo">946</span>     * @return The axis count.<a name="line.946"></a>
<span class="sourceLineNo">947</span>     *<a name="line.947"></a>
<span class="sourceLineNo">948</span>     * @see #getRangeAxisCount()<a name="line.948"></a>
<span class="sourceLineNo">949</span>     */<a name="line.949"></a>
<span class="sourceLineNo">950</span>    public int getDomainAxisCount() {<a name="line.950"></a>
<span class="sourceLineNo">951</span>        return this.domainAxes.size();<a name="line.951"></a>
<span class="sourceLineNo">952</span>    }<a name="line.952"></a>
<span class="sourceLineNo">953</span><a name="line.953"></a>
<span class="sourceLineNo">954</span>    /**<a name="line.954"></a>
<span class="sourceLineNo">955</span>     * Clears the domain axes from the plot and sends a {@link PlotChangeEvent}<a name="line.955"></a>
<span class="sourceLineNo">956</span>     * to all registered listeners.<a name="line.956"></a>
<span class="sourceLineNo">957</span>     *<a name="line.957"></a>
<span class="sourceLineNo">958</span>     * @see #clearRangeAxes()<a name="line.958"></a>
<span class="sourceLineNo">959</span>     */<a name="line.959"></a>
<span class="sourceLineNo">960</span>    public void clearDomainAxes() {<a name="line.960"></a>
<span class="sourceLineNo">961</span>        for (int i = 0; i &lt; this.domainAxes.size(); i++) {<a name="line.961"></a>
<span class="sourceLineNo">962</span>            ValueAxis axis = (ValueAxis) this.domainAxes.get(i);<a name="line.962"></a>
<span class="sourceLineNo">963</span>            if (axis != null) {<a name="line.963"></a>
<span class="sourceLineNo">964</span>                axis.removeChangeListener(this);<a name="line.964"></a>
<span class="sourceLineNo">965</span>            }<a name="line.965"></a>
<span class="sourceLineNo">966</span>        }<a name="line.966"></a>
<span class="sourceLineNo">967</span>        this.domainAxes.clear();<a name="line.967"></a>
<span class="sourceLineNo">968</span>        fireChangeEvent();<a name="line.968"></a>
<span class="sourceLineNo">969</span>    }<a name="line.969"></a>
<span class="sourceLineNo">970</span><a name="line.970"></a>
<span class="sourceLineNo">971</span>    /**<a name="line.971"></a>
<span class="sourceLineNo">972</span>     * Configures the domain axes.<a name="line.972"></a>
<span class="sourceLineNo">973</span>     */<a name="line.973"></a>
<span class="sourceLineNo">974</span>    public void configureDomainAxes() {<a name="line.974"></a>
<span class="sourceLineNo">975</span>        for (int i = 0; i &lt; this.domainAxes.size(); i++) {<a name="line.975"></a>
<span class="sourceLineNo">976</span>            ValueAxis axis = (ValueAxis) this.domainAxes.get(i);<a name="line.976"></a>
<span class="sourceLineNo">977</span>            if (axis != null) {<a name="line.977"></a>
<span class="sourceLineNo">978</span>                axis.configure();<a name="line.978"></a>
<span class="sourceLineNo">979</span>            }<a name="line.979"></a>
<span class="sourceLineNo">980</span>        }<a name="line.980"></a>
<span class="sourceLineNo">981</span>    }<a name="line.981"></a>
<span class="sourceLineNo">982</span><a name="line.982"></a>
<span class="sourceLineNo">983</span>    /**<a name="line.983"></a>
<span class="sourceLineNo">984</span>     * Returns the location for a domain axis.  If this hasn't been set<a name="line.984"></a>
<span class="sourceLineNo">985</span>     * explicitly, the method returns the location that is opposite to the<a name="line.985"></a>
<span class="sourceLineNo">986</span>     * primary domain axis location.<a name="line.986"></a>
<span class="sourceLineNo">987</span>     *<a name="line.987"></a>
<span class="sourceLineNo">988</span>     * @param index  the axis index.<a name="line.988"></a>
<span class="sourceLineNo">989</span>     *<a name="line.989"></a>
<span class="sourceLineNo">990</span>     * @return The location (never &lt;code&gt;null&lt;/code&gt;).<a name="line.990"></a>
<span class="sourceLineNo">991</span>     *<a name="line.991"></a>
<span class="sourceLineNo">992</span>     * @see #setDomainAxisLocation(int, AxisLocation)<a name="line.992"></a>
<span class="sourceLineNo">993</span>     */<a name="line.993"></a>
<span class="sourceLineNo">994</span>    public AxisLocation getDomainAxisLocation(int index) {<a name="line.994"></a>
<span class="sourceLineNo">995</span>        AxisLocation result = null;<a name="line.995"></a>
<span class="sourceLineNo">996</span>        if (index &lt; this.domainAxisLocations.size()) {<a name="line.996"></a>
<span class="sourceLineNo">997</span>            result = (AxisLocation) this.domainAxisLocations.get(index);<a name="line.997"></a>
<span class="sourceLineNo">998</span>        }<a name="line.998"></a>
<span class="sourceLineNo">999</span>        if (result == null) {<a name="line.999"></a>
<span class="sourceLineNo">1000</span>            result = AxisLocation.getOpposite(getDomainAxisLocation());<a name="line.1000"></a>
<span class="sourceLineNo">1001</span>        }<a name="line.1001"></a>
<span class="sourceLineNo">1002</span>        return result;<a name="line.1002"></a>
<span class="sourceLineNo">1003</span>    }<a name="line.1003"></a>
<span class="sourceLineNo">1004</span><a name="line.1004"></a>
<span class="sourceLineNo">1005</span>    /**<a name="line.1005"></a>
<span class="sourceLineNo">1006</span>     * Sets the location for a domain axis and sends a {@link PlotChangeEvent}<a name="line.1006"></a>
<span class="sourceLineNo">1007</span>     * to all registered listeners.<a name="line.1007"></a>
<span class="sourceLineNo">1008</span>     *<a name="line.1008"></a>
<span class="sourceLineNo">1009</span>     * @param index  the axis index.<a name="line.1009"></a>
<span class="sourceLineNo">1010</span>     * @param location  the location (&lt;code&gt;null&lt;/code&gt; not permitted for index<a name="line.1010"></a>
<span class="sourceLineNo">1011</span>     *     0).<a name="line.1011"></a>
<span class="sourceLineNo">1012</span>     *<a name="line.1012"></a>
<span class="sourceLineNo">1013</span>     * @see #getDomainAxisLocation(int)<a name="line.1013"></a>
<span class="sourceLineNo">1014</span>     */<a name="line.1014"></a>
<span class="sourceLineNo">1015</span>    public void setDomainAxisLocation(int index, AxisLocation location) {<a name="line.1015"></a>
<span class="sourceLineNo">1016</span>        // delegate...<a name="line.1016"></a>
<span class="sourceLineNo">1017</span>        setDomainAxisLocation(index, location, true);<a name="line.1017"></a>
<span class="sourceLineNo">1018</span>    }<a name="line.1018"></a>
<span class="sourceLineNo">1019</span><a name="line.1019"></a>
<span class="sourceLineNo">1020</span>    /**<a name="line.1020"></a>
<span class="sourceLineNo">1021</span>     * Sets the axis location for a domain axis and, if requested, sends a<a name="line.1021"></a>
<span class="sourceLineNo">1022</span>     * {@link PlotChangeEvent} to all registered listeners.<a name="line.1022"></a>
<span class="sourceLineNo">1023</span>     *<a name="line.1023"></a>
<span class="sourceLineNo">1024</span>     * @param index  the axis index.<a name="line.1024"></a>
<span class="sourceLineNo">1025</span>     * @param location  the location (&lt;code&gt;null&lt;/code&gt; not permitted for<a name="line.1025"></a>
<span class="sourceLineNo">1026</span>     *     index 0).<a name="line.1026"></a>
<span class="sourceLineNo">1027</span>     * @param notify  notify listeners?<a name="line.1027"></a>
<span class="sourceLineNo">1028</span>     *<a name="line.1028"></a>
<span class="sourceLineNo">1029</span>     * @since 1.0.5<a name="line.1029"></a>
<span class="sourceLineNo">1030</span>     *<a name="line.1030"></a>
<span class="sourceLineNo">1031</span>     * @see #getDomainAxisLocation(int)<a name="line.1031"></a>
<span class="sourceLineNo">1032</span>     * @see #setRangeAxisLocation(int, AxisLocation, boolean)<a name="line.1032"></a>
<span class="sourceLineNo">1033</span>     */<a name="line.1033"></a>
<span class="sourceLineNo">1034</span>    public void setDomainAxisLocation(int index, AxisLocation location,<a name="line.1034"></a>
<span class="sourceLineNo">1035</span>            boolean notify) {<a name="line.1035"></a>
<span class="sourceLineNo">1036</span><a name="line.1036"></a>
<span class="sourceLineNo">1037</span>        if (index == 0 &amp;&amp; location == null) {<a name="line.1037"></a>
<span class="sourceLineNo">1038</span>            throw new IllegalArgumentException(<a name="line.1038"></a>
<span class="sourceLineNo">1039</span>                    "Null 'location' for index 0 not permitted.");<a name="line.1039"></a>
<span class="sourceLineNo">1040</span>        }<a name="line.1040"></a>
<span class="sourceLineNo">1041</span>        this.domainAxisLocations.set(index, location);<a name="line.1041"></a>
<span class="sourceLineNo">1042</span>        if (notify) {<a name="line.1042"></a>
<span class="sourceLineNo">1043</span>            fireChangeEvent();<a name="line.1043"></a>
<span class="sourceLineNo">1044</span>        }<a name="line.1044"></a>
<span class="sourceLineNo">1045</span>    }<a name="line.1045"></a>
<span class="sourceLineNo">1046</span><a name="line.1046"></a>
<span class="sourceLineNo">1047</span>    /**<a name="line.1047"></a>
<span class="sourceLineNo">1048</span>     * Returns the edge for a domain axis.<a name="line.1048"></a>
<span class="sourceLineNo">1049</span>     *<a name="line.1049"></a>
<span class="sourceLineNo">1050</span>     * @param index  the axis index.<a name="line.1050"></a>
<span class="sourceLineNo">1051</span>     *<a name="line.1051"></a>
<span class="sourceLineNo">1052</span>     * @return The edge.<a name="line.1052"></a>
<span class="sourceLineNo">1053</span>     *<a name="line.1053"></a>
<span class="sourceLineNo">1054</span>     * @see #getRangeAxisEdge(int)<a name="line.1054"></a>
<span class="sourceLineNo">1055</span>     */<a name="line.1055"></a>
<span class="sourceLineNo">1056</span>    public RectangleEdge getDomainAxisEdge(int index) {<a name="line.1056"></a>
<span class="sourceLineNo">1057</span>        AxisLocation location = getDomainAxisLocation(index);<a name="line.1057"></a>
<span class="sourceLineNo">1058</span>        RectangleEdge result = Plot.resolveDomainAxisLocation(location,<a name="line.1058"></a>
<span class="sourceLineNo">1059</span>                this.orientation);<a name="line.1059"></a>
<span class="sourceLineNo">1060</span>        if (result == null) {<a name="line.1060"></a>
<span class="sourceLineNo">1061</span>            result = RectangleEdge.opposite(getDomainAxisEdge());<a name="line.1061"></a>
<span class="sourceLineNo">1062</span>        }<a name="line.1062"></a>
<span class="sourceLineNo">1063</span>        return result;<a name="line.1063"></a>
<span class="sourceLineNo">1064</span>    }<a name="line.1064"></a>
<span class="sourceLineNo">1065</span><a name="line.1065"></a>
<span class="sourceLineNo">1066</span>    /**<a name="line.1066"></a>
<span class="sourceLineNo">1067</span>     * Returns the range axis for the plot.  If the range axis for this plot is<a name="line.1067"></a>
<span class="sourceLineNo">1068</span>     * &lt;code&gt;null&lt;/code&gt;, then the method will return the parent plot's range<a name="line.1068"></a>
<span class="sourceLineNo">1069</span>     * axis (if there is a parent plot).<a name="line.1069"></a>
<span class="sourceLineNo">1070</span>     *<a name="line.1070"></a>
<span class="sourceLineNo">1071</span>     * @return The range axis.<a name="line.1071"></a>
<span class="sourceLineNo">1072</span>     *<a name="line.1072"></a>
<span class="sourceLineNo">1073</span>     * @see #getRangeAxis(int)<a name="line.1073"></a>
<span class="sourceLineNo">1074</span>     * @see #setRangeAxis(ValueAxis)<a name="line.1074"></a>
<span class="sourceLineNo">1075</span>     */<a name="line.1075"></a>
<span class="sourceLineNo">1076</span>    public ValueAxis getRangeAxis() {<a name="line.1076"></a>
<span class="sourceLineNo">1077</span>        return getRangeAxis(0);<a name="line.1077"></a>
<span class="sourceLineNo">1078</span>    }<a name="line.1078"></a>
<span class="sourceLineNo">1079</span><a name="line.1079"></a>
<span class="sourceLineNo">1080</span>    /**<a name="line.1080"></a>
<span class="sourceLineNo">1081</span>     * Sets the range axis for the plot and sends a {@link PlotChangeEvent} to<a name="line.1081"></a>
<span class="sourceLineNo">1082</span>     * all registered listeners.<a name="line.1082"></a>
<span class="sourceLineNo">1083</span>     *<a name="line.1083"></a>
<span class="sourceLineNo">1084</span>     * @param axis  the axis (&lt;code&gt;null&lt;/code&gt; permitted).<a name="line.1084"></a>
<span class="sourceLineNo">1085</span>     *<a name="line.1085"></a>
<span class="sourceLineNo">1086</span>     * @see #getRangeAxis()<a name="line.1086"></a>
<span class="sourceLineNo">1087</span>     * @see #setRangeAxis(int, ValueAxis)<a name="line.1087"></a>
<span class="sourceLineNo">1088</span>     */<a name="line.1088"></a>
<span class="sourceLineNo">1089</span>    public void setRangeAxis(ValueAxis axis)  {<a name="line.1089"></a>
<span class="sourceLineNo">1090</span><a name="line.1090"></a>
<span class="sourceLineNo">1091</span>        if (axis != null) {<a name="line.1091"></a>
<span class="sourceLineNo">1092</span>            axis.setPlot(this);<a name="line.1092"></a>
<span class="sourceLineNo">1093</span>        }<a name="line.1093"></a>
<span class="sourceLineNo">1094</span><a name="line.1094"></a>
<span class="sourceLineNo">1095</span>        // plot is likely registered as a listener with the existing axis...<a name="line.1095"></a>
<span class="sourceLineNo">1096</span>        ValueAxis existing = getRangeAxis();<a name="line.1096"></a>
<span class="sourceLineNo">1097</span>        if (existing != null) {<a name="line.1097"></a>
<span class="sourceLineNo">1098</span>            existing.removeChangeListener(this);<a name="line.1098"></a>
<span class="sourceLineNo">1099</span>        }<a name="line.1099"></a>
<span class="sourceLineNo">1100</span><a name="line.1100"></a>
<span class="sourceLineNo">1101</span>        this.rangeAxes.set(0, axis);<a name="line.1101"></a>
<span class="sourceLineNo">1102</span>        if (axis != null) {<a name="line.1102"></a>
<span class="sourceLineNo">1103</span>            axis.configure();<a name="line.1103"></a>
<span class="sourceLineNo">1104</span>            axis.addChangeListener(this);<a name="line.1104"></a>
<span class="sourceLineNo">1105</span>        }<a name="line.1105"></a>
<span class="sourceLineNo">1106</span>        fireChangeEvent();<a name="line.1106"></a>
<span class="sourceLineNo">1107</span><a name="line.1107"></a>
<span class="sourceLineNo">1108</span>    }<a name="line.1108"></a>
<span class="sourceLineNo">1109</span><a name="line.1109"></a>
<span class="sourceLineNo">1110</span>    /**<a name="line.1110"></a>
<span class="sourceLineNo">1111</span>     * Returns the location of the primary range axis.<a name="line.1111"></a>
<span class="sourceLineNo">1112</span>     *<a name="line.1112"></a>
<span class="sourceLineNo">1113</span>     * @return The location (never &lt;code&gt;null&lt;/code&gt;).<a name="line.1113"></a>
<span class="sourceLineNo">1114</span>     *<a name="line.1114"></a>
<span class="sourceLineNo">1115</span>     * @see #setRangeAxisLocation(AxisLocation)<a name="line.1115"></a>
<span class="sourceLineNo">1116</span>     */<a name="line.1116"></a>
<span class="sourceLineNo">1117</span>    public AxisLocation getRangeAxisLocation() {<a name="line.1117"></a>
<span class="sourceLineNo">1118</span>        return (AxisLocation) this.rangeAxisLocations.get(0);<a name="line.1118"></a>
<span class="sourceLineNo">1119</span>    }<a name="line.1119"></a>
<span class="sourceLineNo">1120</span><a name="line.1120"></a>
<span class="sourceLineNo">1121</span>    /**<a name="line.1121"></a>
<span class="sourceLineNo">1122</span>     * Sets the location of the primary range axis and sends a<a name="line.1122"></a>
<span class="sourceLineNo">1123</span>     * {@link PlotChangeEvent} to all registered listeners.<a name="line.1123"></a>
<span class="sourceLineNo">1124</span>     *<a name="line.1124"></a>
<span class="sourceLineNo">1125</span>     * @param location  the location (&lt;code&gt;null&lt;/code&gt; not permitted).<a name="line.1125"></a>
<span class="sourceLineNo">1126</span>     *<a name="line.1126"></a>
<span class="sourceLineNo">1127</span>     * @see #getRangeAxisLocation()<a name="line.1127"></a>
<span class="sourceLineNo">1128</span>     */<a name="line.1128"></a>
<span class="sourceLineNo">1129</span>    public void setRangeAxisLocation(AxisLocation location) {<a name="line.1129"></a>
<span class="sourceLineNo">1130</span>        // delegate...<a name="line.1130"></a>
<span class="sourceLineNo">1131</span>        setRangeAxisLocation(0, location, true);<a name="line.1131"></a>
<span class="sourceLineNo">1132</span>    }<a name="line.1132"></a>
<span class="sourceLineNo">1133</span><a name="line.1133"></a>
<span class="sourceLineNo">1134</span>    /**<a name="line.1134"></a>
<span class="sourceLineNo">1135</span>     * Sets the location of the primary range axis and, if requested, sends a<a name="line.1135"></a>
<span class="sourceLineNo">1136</span>     * {@link PlotChangeEvent} to all registered listeners.<a name="line.1136"></a>
<span class="sourceLineNo">1137</span>     *<a name="line.1137"></a>
<span class="sourceLineNo">1138</span>     * @param location  the location (&lt;code&gt;null&lt;/code&gt; not permitted).<a name="line.1138"></a>
<span class="sourceLineNo">1139</span>     * @param notify  notify listeners?<a name="line.1139"></a>
<span class="sourceLineNo">1140</span>     *<a name="line.1140"></a>
<span class="sourceLineNo">1141</span>     * @see #getRangeAxisLocation()<a name="line.1141"></a>
<span class="sourceLineNo">1142</span>     */<a name="line.1142"></a>
<span class="sourceLineNo">1143</span>    public void setRangeAxisLocation(AxisLocation location, boolean notify) {<a name="line.1143"></a>
<span class="sourceLineNo">1144</span>        // delegate...<a name="line.1144"></a>
<span class="sourceLineNo">1145</span>        setRangeAxisLocation(0, location, notify);<a name="line.1145"></a>
<span class="sourceLineNo">1146</span>    }<a name="line.1146"></a>
<span class="sourceLineNo">1147</span><a name="line.1147"></a>
<span class="sourceLineNo">1148</span>    /**<a name="line.1148"></a>
<span class="sourceLineNo">1149</span>     * Returns the edge for the primary range axis.<a name="line.1149"></a>
<span class="sourceLineNo">1150</span>     *<a name="line.1150"></a>
<span class="sourceLineNo">1151</span>     * @return The range axis edge.<a name="line.1151"></a>
<span class="sourceLineNo">1152</span>     *<a name="line.1152"></a>
<span class="sourceLineNo">1153</span>     * @see #getRangeAxisLocation()<a name="line.1153"></a>
<span class="sourceLineNo">1154</span>     * @see #getOrientation()<a name="line.1154"></a>
<span class="sourceLineNo">1155</span>     */<a name="line.1155"></a>
<span class="sourceLineNo">1156</span>    public RectangleEdge getRangeAxisEdge() {<a name="line.1156"></a>
<span class="sourceLineNo">1157</span>        return Plot.resolveRangeAxisLocation(getRangeAxisLocation(),<a name="line.1157"></a>
<span class="sourceLineNo">1158</span>                this.orientation);<a name="line.1158"></a>
<span class="sourceLineNo">1159</span>    }<a name="line.1159"></a>
<span class="sourceLineNo">1160</span><a name="line.1160"></a>
<span class="sourceLineNo">1161</span>    /**<a name="line.1161"></a>
<span class="sourceLineNo">1162</span>     * Returns a range axis.<a name="line.1162"></a>
<span class="sourceLineNo">1163</span>     *<a name="line.1163"></a>
<span class="sourceLineNo">1164</span>     * @param index  the axis index.<a name="line.1164"></a>
<span class="sourceLineNo">1165</span>     *<a name="line.1165"></a>
<span class="sourceLineNo">1166</span>     * @return The axis (&lt;code&gt;null&lt;/code&gt; possible).<a name="line.1166"></a>
<span class="sourceLineNo">1167</span>     *<a name="line.1167"></a>
<span class="sourceLineNo">1168</span>     * @see #setRangeAxis(int, ValueAxis)<a name="line.1168"></a>
<span class="sourceLineNo">1169</span>     */<a name="line.1169"></a>
<span class="sourceLineNo">1170</span>    public ValueAxis getRangeAxis(int index) {<a name="line.1170"></a>
<span class="sourceLineNo">1171</span>        ValueAxis result = null;<a name="line.1171"></a>
<span class="sourceLineNo">1172</span>        if (index &lt; this.rangeAxes.size()) {<a name="line.1172"></a>
<span class="sourceLineNo">1173</span>            result = (ValueAxis) this.rangeAxes.get(index);<a name="line.1173"></a>
<span class="sourceLineNo">1174</span>        }<a name="line.1174"></a>
<span class="sourceLineNo">1175</span>        if (result == null) {<a name="line.1175"></a>
<span class="sourceLineNo">1176</span>            Plot parent = getParent();<a name="line.1176"></a>
<span class="sourceLineNo">1177</span>            if (parent instanceof XYPlot) {<a name="line.1177"></a>
<span class="sourceLineNo">1178</span>                XYPlot xy = (XYPlot) parent;<a name="line.1178"></a>
<span class="sourceLineNo">1179</span>                result = xy.getRangeAxis(index);<a name="line.1179"></a>
<span class="sourceLineNo">1180</span>            }<a name="line.1180"></a>
<span class="sourceLineNo">1181</span>        }<a name="line.1181"></a>
<span class="sourceLineNo">1182</span>        return result;<a name="line.1182"></a>
<span class="sourceLineNo">1183</span>    }<a name="line.1183"></a>
<span class="sourceLineNo">1184</span><a name="line.1184"></a>
<span class="sourceLineNo">1185</span>    /**<a name="line.1185"></a>
<span class="sourceLineNo">1186</span>     * Sets a range axis and sends a {@link PlotChangeEvent} to all registered<a name="line.1186"></a>
<span class="sourceLineNo">1187</span>     * listeners.<a name="line.1187"></a>
<span class="sourceLineNo">1188</span>     *<a name="line.1188"></a>
<span class="sourceLineNo">1189</span>     * @param index  the axis index.<a name="line.1189"></a>
<span class="sourceLineNo">1190</span>     * @param axis  the axis (&lt;code&gt;null&lt;/code&gt; permitted).<a name="line.1190"></a>
<span class="sourceLineNo">1191</span>     *<a name="line.1191"></a>
<span class="sourceLineNo">1192</span>     * @see #getRangeAxis(int)<a name="line.1192"></a>
<span class="sourceLineNo">1193</span>     */<a name="line.1193"></a>
<span class="sourceLineNo">1194</span>    public void setRangeAxis(int index, ValueAxis axis) {<a name="line.1194"></a>
<span class="sourceLineNo">1195</span>        setRangeAxis(index, axis, true);<a name="line.1195"></a>
<span class="sourceLineNo">1196</span>    }<a name="line.1196"></a>
<span class="sourceLineNo">1197</span><a name="line.1197"></a>
<span class="sourceLineNo">1198</span>    /**<a name="line.1198"></a>
<span class="sourceLineNo">1199</span>     * Sets a range axis and, if requested, sends a {@link PlotChangeEvent} to<a name="line.1199"></a>
<span class="sourceLineNo">1200</span>     * all registered listeners.<a name="line.1200"></a>
<span class="sourceLineNo">1201</span>     *<a name="line.1201"></a>
<span class="sourceLineNo">1202</span>     * @param index  the axis index.<a name="line.1202"></a>
<span class="sourceLineNo">1203</span>     * @param axis  the axis (&lt;code&gt;null&lt;/code&gt; permitted).<a name="line.1203"></a>
<span class="sourceLineNo">1204</span>     * @param notify  notify listeners?<a name="line.1204"></a>
<span class="sourceLineNo">1205</span>     *<a name="line.1205"></a>
<span class="sourceLineNo">1206</span>     * @see #getRangeAxis(int)<a name="line.1206"></a>
<span class="sourceLineNo">1207</span>     */<a name="line.1207"></a>
<span class="sourceLineNo">1208</span>    public void setRangeAxis(int index, ValueAxis axis, boolean notify) {<a name="line.1208"></a>
<span class="sourceLineNo">1209</span>        ValueAxis existing = getRangeAxis(index);<a name="line.1209"></a>
<span class="sourceLineNo">1210</span>        if (existing != null) {<a name="line.1210"></a>
<span class="sourceLineNo">1211</span>            existing.removeChangeListener(this);<a name="line.1211"></a>
<span class="sourceLineNo">1212</span>        }<a name="line.1212"></a>
<span class="sourceLineNo">1213</span>        if (axis != null) {<a name="line.1213"></a>
<span class="sourceLineNo">1214</span>            axis.setPlot(this);<a name="line.1214"></a>
<span class="sourceLineNo">1215</span>        }<a name="line.1215"></a>
<span class="sourceLineNo">1216</span>        this.rangeAxes.set(index, axis);<a name="line.1216"></a>
<span class="sourceLineNo">1217</span>        if (axis != null) {<a name="line.1217"></a>
<span class="sourceLineNo">1218</span>            axis.configure();<a name="line.1218"></a>
<span class="sourceLineNo">1219</span>            axis.addChangeListener(this);<a name="line.1219"></a>
<span class="sourceLineNo">1220</span>        }<a name="line.1220"></a>
<span class="sourceLineNo">1221</span>        if (notify) {<a name="line.1221"></a>
<span class="sourceLineNo">1222</span>            fireChangeEvent();<a name="line.1222"></a>
<span class="sourceLineNo">1223</span>        }<a name="line.1223"></a>
<span class="sourceLineNo">1224</span>    }<a name="line.1224"></a>
<span class="sourceLineNo">1225</span><a name="line.1225"></a>
<span class="sourceLineNo">1226</span>    /**<a name="line.1226"></a>
<span class="sourceLineNo">1227</span>     * Sets the range axes for this plot and sends a {@link PlotChangeEvent}<a name="line.1227"></a>
<span class="sourceLineNo">1228</span>     * to all registered listeners.<a name="line.1228"></a>
<span class="sourceLineNo">1229</span>     *<a name="line.1229"></a>
<span class="sourceLineNo">1230</span>     * @param axes  the axes (&lt;code&gt;null&lt;/code&gt; not permitted).<a name="line.1230"></a>
<span class="sourceLineNo">1231</span>     *<a name="line.1231"></a>
<span class="sourceLineNo">1232</span>     * @see #setDomainAxes(ValueAxis[])<a name="line.1232"></a>
<span class="sourceLineNo">1233</span>     */<a name="line.1233"></a>
<span class="sourceLineNo">1234</span>    public void setRangeAxes(ValueAxis[] axes) {<a name="line.1234"></a>
<span class="sourceLineNo">1235</span>        for (int i = 0; i &lt; axes.length; i++) {<a name="line.1235"></a>
<span class="sourceLineNo">1236</span>            setRangeAxis(i, axes[i], false);<a name="line.1236"></a>
<span class="sourceLineNo">1237</span>        }<a name="line.1237"></a>
<span class="sourceLineNo">1238</span>        fireChangeEvent();<a name="line.1238"></a>
<span class="sourceLineNo">1239</span>    }<a name="line.1239"></a>
<span class="sourceLineNo">1240</span><a name="line.1240"></a>
<span class="sourceLineNo">1241</span>    /**<a name="line.1241"></a>
<span class="sourceLineNo">1242</span>     * Returns the number of range axes.<a name="line.1242"></a>
<span class="sourceLineNo">1243</span>     *<a name="line.1243"></a>
<span class="sourceLineNo">1244</span>     * @return The axis count.<a name="line.1244"></a>
<span class="sourceLineNo">1245</span>     *<a name="line.1245"></a>
<span class="sourceLineNo">1246</span>     * @see #getDomainAxisCount()<a name="line.1246"></a>
<span class="sourceLineNo">1247</span>     */<a name="line.1247"></a>
<span class="sourceLineNo">1248</span>    public int getRangeAxisCount() {<a name="line.1248"></a>
<span class="sourceLineNo">1249</span>        return this.rangeAxes.size();<a name="line.1249"></a>
<span class="sourceLineNo">1250</span>    }<a name="line.1250"></a>
<span class="sourceLineNo">1251</span><a name="line.1251"></a>
<span class="sourceLineNo">1252</span>    /**<a name="line.1252"></a>
<span class="sourceLineNo">1253</span>     * Clears the range axes from the plot and sends a {@link PlotChangeEvent}<a name="line.1253"></a>
<span class="sourceLineNo">1254</span>     * to all registered listeners.<a name="line.1254"></a>
<span class="sourceLineNo">1255</span>     *<a name="line.1255"></a>
<span class="sourceLineNo">1256</span>     * @see #clearDomainAxes()<a name="line.1256"></a>
<span class="sourceLineNo">1257</span>     */<a name="line.1257"></a>
<span class="sourceLineNo">1258</span>    public void clearRangeAxes() {<a name="line.1258"></a>
<span class="sourceLineNo">1259</span>        for (int i = 0; i &lt; this.rangeAxes.size(); i++) {<a name="line.1259"></a>
<span class="sourceLineNo">1260</span>            ValueAxis axis = (ValueAxis) this.rangeAxes.get(i);<a name="line.1260"></a>
<span class="sourceLineNo">1261</span>            if (axis != null) {<a name="line.1261"></a>
<span class="sourceLineNo">1262</span>                axis.removeChangeListener(this);<a name="line.1262"></a>
<span class="sourceLineNo">1263</span>            }<a name="line.1263"></a>
<span class="sourceLineNo">1264</span>        }<a name="line.1264"></a>
<span class="sourceLineNo">1265</span>        this.rangeAxes.clear();<a name="line.1265"></a>
<span class="sourceLineNo">1266</span>        fireChangeEvent();<a name="line.1266"></a>
<span class="sourceLineNo">1267</span>    }<a name="line.1267"></a>
<span class="sourceLineNo">1268</span><a name="line.1268"></a>
<span class="sourceLineNo">1269</span>    /**<a name="line.1269"></a>
<span class="sourceLineNo">1270</span>     * Configures the range axes.<a name="line.1270"></a>
<span class="sourceLineNo">1271</span>     *<a name="line.1271"></a>
<span class="sourceLineNo">1272</span>     * @see #configureDomainAxes()<a name="line.1272"></a>
<span class="sourceLineNo">1273</span>     */<a name="line.1273"></a>
<span class="sourceLineNo">1274</span>    public void configureRangeAxes() {<a name="line.1274"></a>
<span class="sourceLineNo">1275</span>        for (int i = 0; i &lt; this.rangeAxes.size(); i++) {<a name="line.1275"></a>
<span class="sourceLineNo">1276</span>            ValueAxis axis = (ValueAxis) this.rangeAxes.get(i);<a name="line.1276"></a>
<span class="sourceLineNo">1277</span>            if (axis != null) {<a name="line.1277"></a>
<span class="sourceLineNo">1278</span>                axis.configure();<a name="line.1278"></a>
<span class="sourceLineNo">1279</span>            }<a name="line.1279"></a>
<span class="sourceLineNo">1280</span>        }<a name="line.1280"></a>
<span class="sourceLineNo">1281</span>    }<a name="line.1281"></a>
<span class="sourceLineNo">1282</span><a name="line.1282"></a>
<span class="sourceLineNo">1283</span>    /**<a name="line.1283"></a>
<span class="sourceLineNo">1284</span>     * Returns the location for a range axis.  If this hasn't been set<a name="line.1284"></a>
<span class="sourceLineNo">1285</span>     * explicitly, the method returns the location that is opposite to the<a name="line.1285"></a>
<span class="sourceLineNo">1286</span>     * primary range axis location.<a name="line.1286"></a>
<span class="sourceLineNo">1287</span>     *<a name="line.1287"></a>
<span class="sourceLineNo">1288</span>     * @param index  the axis index.<a name="line.1288"></a>
<span class="sourceLineNo">1289</span>     *<a name="line.1289"></a>
<span class="sourceLineNo">1290</span>     * @return The location (never &lt;code&gt;null&lt;/code&gt;).<a name="line.1290"></a>
<span class="sourceLineNo">1291</span>     *<a name="line.1291"></a>
<span class="sourceLineNo">1292</span>     * @see #setRangeAxisLocation(int, AxisLocation)<a name="line.1292"></a>
<span class="sourceLineNo">1293</span>     */<a name="line.1293"></a>
<span class="sourceLineNo">1294</span>    public AxisLocation getRangeAxisLocation(int index) {<a name="line.1294"></a>
<span class="sourceLineNo">1295</span>        AxisLocation result = null;<a name="line.1295"></a>
<span class="sourceLineNo">1296</span>        if (index &lt; this.rangeAxisLocations.size()) {<a name="line.1296"></a>
<span class="sourceLineNo">1297</span>            result = (AxisLocation) this.rangeAxisLocations.get(index);<a name="line.1297"></a>
<span class="sourceLineNo">1298</span>        }<a name="line.1298"></a>
<span class="sourceLineNo">1299</span>        if (result == null) {<a name="line.1299"></a>
<span class="sourceLineNo">1300</span>            result = AxisLocation.getOpposite(getRangeAxisLocation());<a name="line.1300"></a>
<span class="sourceLineNo">1301</span>        }<a name="line.1301"></a>
<span class="sourceLineNo">1302</span>        return result;<a name="line.1302"></a>
<span class="sourceLineNo">1303</span>    }<a name="line.1303"></a>
<span class="sourceLineNo">1304</span><a name="line.1304"></a>
<span class="sourceLineNo">1305</span>    /**<a name="line.1305"></a>
<span class="sourceLineNo">1306</span>     * Sets the location for a range axis and sends a {@link PlotChangeEvent}<a name="line.1306"></a>
<span class="sourceLineNo">1307</span>     * to all registered listeners.<a name="line.1307"></a>
<span class="sourceLineNo">1308</span>     *<a name="line.1308"></a>
<span class="sourceLineNo">1309</span>     * @param index  the axis index.<a name="line.1309"></a>
<span class="sourceLineNo">1310</span>     * @param location  the location (&lt;code&gt;null&lt;/code&gt; permitted).<a name="line.1310"></a>
<span class="sourceLineNo">1311</span>     *<a name="line.1311"></a>
<span class="sourceLineNo">1312</span>     * @see #getRangeAxisLocation(int)<a name="line.1312"></a>
<span class="sourceLineNo">1313</span>     */<a name="line.1313"></a>
<span class="sourceLineNo">1314</span>    public void setRangeAxisLocation(int index, AxisLocation location) {<a name="line.1314"></a>
<span class="sourceLineNo">1315</span>        // delegate...<a name="line.1315"></a>
<span class="sourceLineNo">1316</span>        setRangeAxisLocation(index, location, true);<a name="line.1316"></a>
<span class="sourceLineNo">1317</span>    }<a name="line.1317"></a>
<span class="sourceLineNo">1318</span><a name="line.1318"></a>
<span class="sourceLineNo">1319</span>    /**<a name="line.1319"></a>
<span class="sourceLineNo">1320</span>     * Sets the axis location for a domain axis and, if requested, sends a<a name="line.1320"></a>
<span class="sourceLineNo">1321</span>     * {@link PlotChangeEvent} to all registered listeners.<a name="line.1321"></a>
<span class="sourceLineNo">1322</span>     *<a name="line.1322"></a>
<span class="sourceLineNo">1323</span>     * @param index  the axis index.<a name="line.1323"></a>
<span class="sourceLineNo">1324</span>     * @param location  the location (&lt;code&gt;null&lt;/code&gt; not permitted for<a name="line.1324"></a>
<span class="sourceLineNo">1325</span>     *     index 0).<a name="line.1325"></a>
<span class="sourceLineNo">1326</span>     * @param notify  notify listeners?<a name="line.1326"></a>
<span class="sourceLineNo">1327</span>     *<a name="line.1327"></a>
<span class="sourceLineNo">1328</span>     * @since 1.0.5<a name="line.1328"></a>
<span class="sourceLineNo">1329</span>     *<a name="line.1329"></a>
<span class="sourceLineNo">1330</span>     * @see #getRangeAxisLocation(int)<a name="line.1330"></a>
<span class="sourceLineNo">1331</span>     * @see #setDomainAxisLocation(int, AxisLocation, boolean)<a name="line.1331"></a>
<span class="sourceLineNo">1332</span>     */<a name="line.1332"></a>
<span class="sourceLineNo">1333</span>    public void setRangeAxisLocation(int index, AxisLocation location,<a name="line.1333"></a>
<span class="sourceLineNo">1334</span>            boolean notify) {<a name="line.1334"></a>
<span class="sourceLineNo">1335</span><a name="line.1335"></a>
<span class="sourceLineNo">1336</span>        if (index == 0 &amp;&amp; location == null) {<a name="line.1336"></a>
<span class="sourceLineNo">1337</span>            throw new IllegalArgumentException(<a name="line.1337"></a>
<span class="sourceLineNo">1338</span>                    "Null 'location' for index 0 not permitted.");<a name="line.1338"></a>
<span class="sourceLineNo">1339</span>        }<a name="line.1339"></a>
<span class="sourceLineNo">1340</span>        this.rangeAxisLocations.set(index, location);<a name="line.1340"></a>
<span class="sourceLineNo">1341</span>        if (notify) {<a name="line.1341"></a>
<span class="sourceLineNo">1342</span>            fireChangeEvent();<a name="line.1342"></a>
<span class="sourceLineNo">1343</span>        }<a name="line.1343"></a>
<span class="sourceLineNo">1344</span>    }<a name="line.1344"></a>
<span class="sourceLineNo">1345</span><a name="line.1345"></a>
<span class="sourceLineNo">1346</span>    /**<a name="line.1346"></a>
<span class="sourceLineNo">1347</span>     * Returns the edge for a range axis.<a name="line.1347"></a>
<span class="sourceLineNo">1348</span>     *<a name="line.1348"></a>
<span class="sourceLineNo">1349</span>     * @param index  the axis index.<a name="line.1349"></a>
<span class="sourceLineNo">1350</span>     *<a name="line.1350"></a>
<span class="sourceLineNo">1351</span>     * @return The edge.<a name="line.1351"></a>
<span class="sourceLineNo">1352</span>     *<a name="line.1352"></a>
<span class="sourceLineNo">1353</span>     * @see #getRangeAxisLocation(int)<a name="line.1353"></a>
<span class="sourceLineNo">1354</span>     * @see #getOrientation()<a name="line.1354"></a>
<span class="sourceLineNo">1355</span>     */<a name="line.1355"></a>
<span class="sourceLineNo">1356</span>    public RectangleEdge getRangeAxisEdge(int index) {<a name="line.1356"></a>
<span class="sourceLineNo">1357</span>        AxisLocation location = getRangeAxisLocation(index);<a name="line.1357"></a>
<span class="sourceLineNo">1358</span>        RectangleEdge result = Plot.resolveRangeAxisLocation(location,<a name="line.1358"></a>
<span class="sourceLineNo">1359</span>                this.orientation);<a name="line.1359"></a>
<span class="sourceLineNo">1360</span>        if (result == null) {<a name="line.1360"></a>
<span class="sourceLineNo">1361</span>            result = RectangleEdge.opposite(getRangeAxisEdge());<a name="line.1361"></a>
<span class="sourceLineNo">1362</span>        }<a name="line.1362"></a>
<span class="sourceLineNo">1363</span>        return result;<a name="line.1363"></a>
<span class="sourceLineNo">1364</span>    }<a name="line.1364"></a>
<span class="sourceLineNo">1365</span><a name="line.1365"></a>
<span class="sourceLineNo">1366</span>    /**<a name="line.1366"></a>
<span class="sourceLineNo">1367</span>     * Returns the primary dataset for the plot.<a name="line.1367"></a>
<span class="sourceLineNo">1368</span>     *<a name="line.1368"></a>
<span class="sourceLineNo">1369</span>     * @return The primary dataset (possibly &lt;code&gt;null&lt;/code&gt;).<a name="line.1369"></a>
<span class="sourceLineNo">1370</span>     *<a name="line.1370"></a>
<span class="sourceLineNo">1371</span>     * @see #getDataset(int)<a name="line.1371"></a>
<span class="sourceLineNo">1372</span>     * @see #setDataset(XYDataset)<a name="line.1372"></a>
<span class="sourceLineNo">1373</span>     */<a name="line.1373"></a>
<span class="sourceLineNo">1374</span>    public XYDataset getDataset() {<a name="line.1374"></a>
<span class="sourceLineNo">1375</span>        return getDataset(0);<a name="line.1375"></a>
<span class="sourceLineNo">1376</span>    }<a name="line.1376"></a>
<span class="sourceLineNo">1377</span><a name="line.1377"></a>
<span class="sourceLineNo">1378</span>    /**<a name="line.1378"></a>
<span class="sourceLineNo">1379</span>     * Returns a dataset.<a name="line.1379"></a>
<span class="sourceLineNo">1380</span>     *<a name="line.1380"></a>
<span class="sourceLineNo">1381</span>     * @param index  the dataset index.<a name="line.1381"></a>
<span class="sourceLineNo">1382</span>     *<a name="line.1382"></a>
<span class="sourceLineNo">1383</span>     * @return The dataset (possibly &lt;code&gt;null&lt;/code&gt;).<a name="line.1383"></a>
<span class="sourceLineNo">1384</span>     *<a name="line.1384"></a>
<span class="sourceLineNo">1385</span>     * @see #setDataset(int, XYDataset)<a name="line.1385"></a>
<span class="sourceLineNo">1386</span>     */<a name="line.1386"></a>
<span class="sourceLineNo">1387</span>    public XYDataset getDataset(int index) {<a name="line.1387"></a>
<span class="sourceLineNo">1388</span>        XYDataset result = null;<a name="line.1388"></a>
<span class="sourceLineNo">1389</span>        if (this.datasets.size() &gt; index) {<a name="line.1389"></a>
<span class="sourceLineNo">1390</span>            result = (XYDataset) this.datasets.get(index);<a name="line.1390"></a>
<span class="sourceLineNo">1391</span>        }<a name="line.1391"></a>
<span class="sourceLineNo">1392</span>        return result;<a name="line.1392"></a>
<span class="sourceLineNo">1393</span>    }<a name="line.1393"></a>
<span class="sourceLineNo">1394</span><a name="line.1394"></a>
<span class="sourceLineNo">1395</span>    /**<a name="line.1395"></a>
<span class="sourceLineNo">1396</span>     * Sets the primary dataset for the plot, replacing the existing dataset if<a name="line.1396"></a>
<span class="sourceLineNo">1397</span>     * there is one.<a name="line.1397"></a>
<span class="sourceLineNo">1398</span>     *<a name="line.1398"></a>
<span class="sourceLineNo">1399</span>     * @param dataset  the dataset (&lt;code&gt;null&lt;/code&gt; permitted).<a name="line.1399"></a>
<span class="sourceLineNo">1400</span>     *<a name="line.1400"></a>
<span class="sourceLineNo">1401</span>     * @see #getDataset()<a name="line.1401"></a>
<span class="sourceLineNo">1402</span>     * @see #setDataset(int, XYDataset)<a name="line.1402"></a>
<span class="sourceLineNo">1403</span>     */<a name="line.1403"></a>
<span class="sourceLineNo">1404</span>    public void setDataset(XYDataset dataset) {<a name="line.1404"></a>
<span class="sourceLineNo">1405</span>        setDataset(0, dataset);<a name="line.1405"></a>
<span class="sourceLineNo">1406</span>    }<a name="line.1406"></a>
<span class="sourceLineNo">1407</span><a name="line.1407"></a>
<span class="sourceLineNo">1408</span>    /**<a name="line.1408"></a>
<span class="sourceLineNo">1409</span>     * Sets a dataset for the plot.<a name="line.1409"></a>
<span class="sourceLineNo">1410</span>     *<a name="line.1410"></a>
<span class="sourceLineNo">1411</span>     * @param index  the dataset index.<a name="line.1411"></a>
<span class="sourceLineNo">1412</span>     * @param dataset  the dataset (&lt;code&gt;null&lt;/code&gt; permitted).<a name="line.1412"></a>
<span class="sourceLineNo">1413</span>     *<a name="line.1413"></a>
<span class="sourceLineNo">1414</span>     * @see #getDataset(int)<a name="line.1414"></a>
<span class="sourceLineNo">1415</span>     */<a name="line.1415"></a>
<span class="sourceLineNo">1416</span>    public void setDataset(int index, XYDataset dataset) {<a name="line.1416"></a>
<span class="sourceLineNo">1417</span>        XYDataset existing = getDataset(index);<a name="line.1417"></a>
<span class="sourceLineNo">1418</span>        if (existing != null) {<a name="line.1418"></a>
<span class="sourceLineNo">1419</span>            existing.removeChangeListener(this);<a name="line.1419"></a>
<span class="sourceLineNo">1420</span>        }<a name="line.1420"></a>
<span class="sourceLineNo">1421</span>        this.datasets.set(index, dataset);<a name="line.1421"></a>
<span class="sourceLineNo">1422</span>        if (dataset != null) {<a name="line.1422"></a>
<span class="sourceLineNo">1423</span>            dataset.addChangeListener(this);<a name="line.1423"></a>
<span class="sourceLineNo">1424</span>        }<a name="line.1424"></a>
<span class="sourceLineNo">1425</span><a name="line.1425"></a>
<span class="sourceLineNo">1426</span>        // send a dataset change event to self...<a name="line.1426"></a>
<span class="sourceLineNo">1427</span>        DatasetChangeEvent event = new DatasetChangeEvent(this, dataset);<a name="line.1427"></a>
<span class="sourceLineNo">1428</span>        datasetChanged(event);<a name="line.1428"></a>
<span class="sourceLineNo">1429</span>    }<a name="line.1429"></a>
<span class="sourceLineNo">1430</span><a name="line.1430"></a>
<span class="sourceLineNo">1431</span>    /**<a name="line.1431"></a>
<span class="sourceLineNo">1432</span>     * Returns the number of datasets.<a name="line.1432"></a>
<span class="sourceLineNo">1433</span>     *<a name="line.1433"></a>
<span class="sourceLineNo">1434</span>     * @return The number of datasets.<a name="line.1434"></a>
<span class="sourceLineNo">1435</span>     */<a name="line.1435"></a>
<span class="sourceLineNo">1436</span>    public int getDatasetCount() {<a name="line.1436"></a>
<span class="sourceLineNo">1437</span>        return this.datasets.size();<a name="line.1437"></a>
<span class="sourceLineNo">1438</span>    }<a name="line.1438"></a>
<span class="sourceLineNo">1439</span><a name="line.1439"></a>
<span class="sourceLineNo">1440</span>    /**<a name="line.1440"></a>
<span class="sourceLineNo">1441</span>     * Returns the index of the specified dataset, or &lt;code&gt;-1&lt;/code&gt; if the<a name="line.1441"></a>
<span class="sourceLineNo">1442</span>     * dataset does not belong to the plot.<a name="line.1442"></a>
<span class="sourceLineNo">1443</span>     *<a name="line.1443"></a>
<span class="sourceLineNo">1444</span>     * @param dataset  the dataset (&lt;code&gt;null&lt;/code&gt; not permitted).<a name="line.1444"></a>
<span class="sourceLineNo">1445</span>     *<a name="line.1445"></a>
<span class="sourceLineNo">1446</span>     * @return The index.<a name="line.1446"></a>
<span class="sourceLineNo">1447</span>     */<a name="line.1447"></a>
<span class="sourceLineNo">1448</span>    public int indexOf(XYDataset dataset) {<a name="line.1448"></a>
<span class="sourceLineNo">1449</span>        int result = -1;<a name="line.1449"></a>
<span class="sourceLineNo">1450</span>        for (int i = 0; i &lt; this.datasets.size(); i++) {<a name="line.1450"></a>
<span class="sourceLineNo">1451</span>            if (dataset == this.datasets.get(i)) {<a name="line.1451"></a>
<span class="sourceLineNo">1452</span>                result = i;<a name="line.1452"></a>
<span class="sourceLineNo">1453</span>                break;<a name="line.1453"></a>
<span class="sourceLineNo">1454</span>            }<a name="line.1454"></a>
<span class="sourceLineNo">1455</span>        }<a name="line.1455"></a>
<span class="sourceLineNo">1456</span>        return result;<a name="line.1456"></a>
<span class="sourceLineNo">1457</span>    }<a name="line.1457"></a>
<span class="sourceLineNo">1458</span><a name="line.1458"></a>
<span class="sourceLineNo">1459</span>    /**<a name="line.1459"></a>
<span class="sourceLineNo">1460</span>     * Maps a dataset to a particular domain axis.  All data will be plotted<a name="line.1460"></a>
<span class="sourceLineNo">1461</span>     * against axis zero by default, no mapping is required for this case.<a name="line.1461"></a>
<span class="sourceLineNo">1462</span>     *<a name="line.1462"></a>
<span class="sourceLineNo">1463</span>     * @param index  the dataset index (zero-based).<a name="line.1463"></a>
<span class="sourceLineNo">1464</span>     * @param axisIndex  the axis index.<a name="line.1464"></a>
<span class="sourceLineNo">1465</span>     *<a name="line.1465"></a>
<span class="sourceLineNo">1466</span>     * @see #mapDatasetToRangeAxis(int, int)<a name="line.1466"></a>
<span class="sourceLineNo">1467</span>     */<a name="line.1467"></a>
<span class="sourceLineNo">1468</span>    public void mapDatasetToDomainAxis(int index, int axisIndex) {<a name="line.1468"></a>
<span class="sourceLineNo">1469</span>        List axisIndices = new java.util.ArrayList(1);<a name="line.1469"></a>
<span class="sourceLineNo">1470</span>        axisIndices.add(new Integer(axisIndex));<a name="line.1470"></a>
<span class="sourceLineNo">1471</span>        mapDatasetToDomainAxes(index, axisIndices);<a name="line.1471"></a>
<span class="sourceLineNo">1472</span>    }<a name="line.1472"></a>
<span class="sourceLineNo">1473</span><a name="line.1473"></a>
<span class="sourceLineNo">1474</span>    /**<a name="line.1474"></a>
<span class="sourceLineNo">1475</span>     * Maps the specified dataset to the axes in the list.  Note that the<a name="line.1475"></a>
<span class="sourceLineNo">1476</span>     * conversion of data values into Java2D space is always performed using<a name="line.1476"></a>
<span class="sourceLineNo">1477</span>     * the first axis in the list.<a name="line.1477"></a>
<span class="sourceLineNo">1478</span>     *<a name="line.1478"></a>
<span class="sourceLineNo">1479</span>     * @param index  the dataset index (zero-based).<a name="line.1479"></a>
<span class="sourceLineNo">1480</span>     * @param axisIndices  the axis indices (&lt;code&gt;null&lt;/code&gt; permitted).<a name="line.1480"></a>
<span class="sourceLineNo">1481</span>     *<a name="line.1481"></a>
<span class="sourceLineNo">1482</span>     * @since 1.0.12<a name="line.1482"></a>
<span class="sourceLineNo">1483</span>     */<a name="line.1483"></a>
<span class="sourceLineNo">1484</span>    public void mapDatasetToDomainAxes(int index, List axisIndices) {<a name="line.1484"></a>
<span class="sourceLineNo">1485</span>        if (index &lt; 0) {<a name="line.1485"></a>
<span class="sourceLineNo">1486</span>            throw new IllegalArgumentException("Requires 'index' &gt;= 0.");<a name="line.1486"></a>
<span class="sourceLineNo">1487</span>        }<a name="line.1487"></a>
<span class="sourceLineNo">1488</span>        checkAxisIndices(axisIndices);<a name="line.1488"></a>
<span class="sourceLineNo">1489</span>        Integer key = new Integer(index);<a name="line.1489"></a>
<span class="sourceLineNo">1490</span>        this.datasetToDomainAxesMap.put(key, new ArrayList(axisIndices));<a name="line.1490"></a>
<span class="sourceLineNo">1491</span>        // fake a dataset change event to update axes...<a name="line.1491"></a>
<span class="sourceLineNo">1492</span>        datasetChanged(new DatasetChangeEvent(this, getDataset(index)));<a name="line.1492"></a>
<span class="sourceLineNo">1493</span>    }<a name="line.1493"></a>
<span class="sourceLineNo">1494</span><a name="line.1494"></a>
<span class="sourceLineNo">1495</span>    /**<a name="line.1495"></a>
<span class="sourceLineNo">1496</span>     * Maps a dataset to a particular range axis.  All data will be plotted<a name="line.1496"></a>
<span class="sourceLineNo">1497</span>     * against axis zero by default, no mapping is required for this case.<a name="line.1497"></a>
<span class="sourceLineNo">1498</span>     *<a name="line.1498"></a>
<span class="sourceLineNo">1499</span>     * @param index  the dataset index (zero-based).<a name="line.1499"></a>
<span class="sourceLineNo">1500</span>     * @param axisIndex  the axis index.<a name="line.1500"></a>
<span class="sourceLineNo">1501</span>     *<a name="line.1501"></a>
<span class="sourceLineNo">1502</span>     * @see #mapDatasetToDomainAxis(int, int)<a name="line.1502"></a>
<span class="sourceLineNo">1503</span>     */<a name="line.1503"></a>
<span class="sourceLineNo">1504</span>    public void mapDatasetToRangeAxis(int index, int axisIndex) {<a name="line.1504"></a>
<span class="sourceLineNo">1505</span>        List axisIndices = new java.util.ArrayList(1);<a name="line.1505"></a>
<span class="sourceLineNo">1506</span>        axisIndices.add(new Integer(axisIndex));<a name="line.1506"></a>
<span class="sourceLineNo">1507</span>        mapDatasetToRangeAxes(index, axisIndices);<a name="line.1507"></a>
<span class="sourceLineNo">1508</span>    }<a name="line.1508"></a>
<span class="sourceLineNo">1509</span><a name="line.1509"></a>
<span class="sourceLineNo">1510</span>    /**<a name="line.1510"></a>
<span class="sourceLineNo">1511</span>     * Maps the specified dataset to the axes in the list.  Note that the<a name="line.1511"></a>
<span class="sourceLineNo">1512</span>     * conversion of data values into Java2D space is always performed using<a name="line.1512"></a>
<span class="sourceLineNo">1513</span>     * the first axis in the list.<a name="line.1513"></a>
<span class="sourceLineNo">1514</span>     *<a name="line.1514"></a>
<span class="sourceLineNo">1515</span>     * @param index  the dataset index (zero-based).<a name="line.1515"></a>
<span class="sourceLineNo">1516</span>     * @param axisIndices  the axis indices (&lt;code&gt;null&lt;/code&gt; permitted).<a name="line.1516"></a>
<span class="sourceLineNo">1517</span>     *<a name="line.1517"></a>
<span class="sourceLineNo">1518</span>     * @since 1.0.12<a name="line.1518"></a>
<span class="sourceLineNo">1519</span>     */<a name="line.1519"></a>
<span class="sourceLineNo">1520</span>    public void mapDatasetToRangeAxes(int index, List axisIndices) {<a name="line.1520"></a>
<span class="sourceLineNo">1521</span>        if (index &lt; 0) {<a name="line.1521"></a>
<span class="sourceLineNo">1522</span>            throw new IllegalArgumentException("Requires 'index' &gt;= 0.");<a name="line.1522"></a>
<span class="sourceLineNo">1523</span>        }<a name="line.1523"></a>
<span class="sourceLineNo">1524</span>        checkAxisIndices(axisIndices);<a name="line.1524"></a>
<span class="sourceLineNo">1525</span>        Integer key = new Integer(index);<a name="line.1525"></a>
<span class="sourceLineNo">1526</span>        this.datasetToRangeAxesMap.put(key, new ArrayList(axisIndices));<a name="line.1526"></a>
<span class="sourceLineNo">1527</span>        // fake a dataset change event to update axes...<a name="line.1527"></a>
<span class="sourceLineNo">1528</span>        datasetChanged(new DatasetChangeEvent(this, getDataset(index)));<a name="line.1528"></a>
<span class="sourceLineNo">1529</span>    }<a name="line.1529"></a>
<span class="sourceLineNo">1530</span><a name="line.1530"></a>
<span class="sourceLineNo">1531</span>    /**<a name="line.1531"></a>
<span class="sourceLineNo">1532</span>     * This method is used to perform argument checking on the list of<a name="line.1532"></a>
<span class="sourceLineNo">1533</span>     * axis indices passed to mapDatasetToDomainAxes() and<a name="line.1533"></a>
<span class="sourceLineNo">1534</span>     * mapDatasetToRangeAxes().<a name="line.1534"></a>
<span class="sourceLineNo">1535</span>     *<a name="line.1535"></a>
<span class="sourceLineNo">1536</span>     * @param indices  the list of indices (&lt;code&gt;null&lt;/code&gt; permitted).<a name="line.1536"></a>
<span class="sourceLineNo">1537</span>     */<a name="line.1537"></a>
<span class="sourceLineNo">1538</span>    private void checkAxisIndices(List indices) {<a name="line.1538"></a>
<span class="sourceLineNo">1539</span>        // axisIndices can be:<a name="line.1539"></a>
<span class="sourceLineNo">1540</span>        // 1.  null;<a name="line.1540"></a>
<span class="sourceLineNo">1541</span>        // 2.  non-empty, containing only Integer objects that are unique.<a name="line.1541"></a>
<span class="sourceLineNo">1542</span>        if (indices == null) {<a name="line.1542"></a>
<span class="sourceLineNo">1543</span>            return;  // OK<a name="line.1543"></a>
<span class="sourceLineNo">1544</span>        }<a name="line.1544"></a>
<span class="sourceLineNo">1545</span>        int count = indices.size();<a name="line.1545"></a>
<span class="sourceLineNo">1546</span>        if (count == 0) {<a name="line.1546"></a>
<span class="sourceLineNo">1547</span>            throw new IllegalArgumentException("Empty list not permitted.");<a name="line.1547"></a>
<span class="sourceLineNo">1548</span>        }<a name="line.1548"></a>
<span class="sourceLineNo">1549</span>        HashSet set = new HashSet();<a name="line.1549"></a>
<span class="sourceLineNo">1550</span>        for (int i = 0; i &lt; count; i++) {<a name="line.1550"></a>
<span class="sourceLineNo">1551</span>            Object item = indices.get(i);<a name="line.1551"></a>
<span class="sourceLineNo">1552</span>            if (!(item instanceof Integer)) {<a name="line.1552"></a>
<span class="sourceLineNo">1553</span>                throw new IllegalArgumentException(<a name="line.1553"></a>
<span class="sourceLineNo">1554</span>                        "Indices must be Integer instances.");<a name="line.1554"></a>
<span class="sourceLineNo">1555</span>            }<a name="line.1555"></a>
<span class="sourceLineNo">1556</span>            if (set.contains(item)) {<a name="line.1556"></a>
<span class="sourceLineNo">1557</span>                throw new IllegalArgumentException("Indices must be unique.");<a name="line.1557"></a>
<span class="sourceLineNo">1558</span>            }<a name="line.1558"></a>
<span class="sourceLineNo">1559</span>            set.add(item);<a name="line.1559"></a>
<span class="sourceLineNo">1560</span>        }<a name="line.1560"></a>
<span class="sourceLineNo">1561</span>    }<a name="line.1561"></a>
<span class="sourceLineNo">1562</span><a name="line.1562"></a>
<span class="sourceLineNo">1563</span>    /**<a name="line.1563"></a>
<span class="sourceLineNo">1564</span>     * Returns the number of renderer slots for this plot.<a name="line.1564"></a>
<span class="sourceLineNo">1565</span>     *<a name="line.1565"></a>
<span class="sourceLineNo">1566</span>     * @return The number of renderer slots.<a name="line.1566"></a>
<span class="sourceLineNo">1567</span>     *<a name="line.1567"></a>
<span class="sourceLineNo">1568</span>     * @since 1.0.11<a name="line.1568"></a>
<span class="sourceLineNo">1569</span>     */<a name="line.1569"></a>
<span class="sourceLineNo">1570</span>    public int getRendererCount() {<a name="line.1570"></a>
<span class="sourceLineNo">1571</span>        return this.renderers.size();<a name="line.1571"></a>
<span class="sourceLineNo">1572</span>    }<a name="line.1572"></a>
<span class="sourceLineNo">1573</span><a name="line.1573"></a>
<span class="sourceLineNo">1574</span>    /**<a name="line.1574"></a>
<span class="sourceLineNo">1575</span>     * Returns the renderer for the primary dataset.<a name="line.1575"></a>
<span class="sourceLineNo">1576</span>     *<a name="line.1576"></a>
<span class="sourceLineNo">1577</span>     * @return The item renderer (possibly &lt;code&gt;null&lt;/code&gt;).<a name="line.1577"></a>
<span class="sourceLineNo">1578</span>     *<a name="line.1578"></a>
<span class="sourceLineNo">1579</span>     * @see #setRenderer(XYItemRenderer)<a name="line.1579"></a>
<span class="sourceLineNo">1580</span>     */<a name="line.1580"></a>
<span class="sourceLineNo">1581</span>    public XYItemRenderer getRenderer() {<a name="line.1581"></a>
<span class="sourceLineNo">1582</span>        return getRenderer(0);<a name="line.1582"></a>
<span class="sourceLineNo">1583</span>    }<a name="line.1583"></a>
<span class="sourceLineNo">1584</span><a name="line.1584"></a>
<span class="sourceLineNo">1585</span>    /**<a name="line.1585"></a>
<span class="sourceLineNo">1586</span>     * Returns the renderer for a dataset, or &lt;code&gt;null&lt;/code&gt;.<a name="line.1586"></a>
<span class="sourceLineNo">1587</span>     *<a name="line.1587"></a>
<span class="sourceLineNo">1588</span>     * @param index  the renderer index.<a name="line.1588"></a>
<span class="sourceLineNo">1589</span>     *<a name="line.1589"></a>
<span class="sourceLineNo">1590</span>     * @return The renderer (possibly &lt;code&gt;null&lt;/code&gt;).<a name="line.1590"></a>
<span class="sourceLineNo">1591</span>     *<a name="line.1591"></a>
<span class="sourceLineNo">1592</span>     * @see #setRenderer(int, XYItemRenderer)<a name="line.1592"></a>
<span class="sourceLineNo">1593</span>     */<a name="line.1593"></a>
<span class="sourceLineNo">1594</span>    public XYItemRenderer getRenderer(int index) {<a name="line.1594"></a>
<span class="sourceLineNo">1595</span>        XYItemRenderer result = null;<a name="line.1595"></a>
<span class="sourceLineNo">1596</span>        if (this.renderers.size() &gt; index) {<a name="line.1596"></a>
<span class="sourceLineNo">1597</span>            result = (XYItemRenderer) this.renderers.get(index);<a name="line.1597"></a>
<span class="sourceLineNo">1598</span>        }<a name="line.1598"></a>
<span class="sourceLineNo">1599</span>        return result;<a name="line.1599"></a>
<span class="sourceLineNo">1600</span><a name="line.1600"></a>
<span class="sourceLineNo">1601</span>    }<a name="line.1601"></a>
<span class="sourceLineNo">1602</span><a name="line.1602"></a>
<span class="sourceLineNo">1603</span>    /**<a name="line.1603"></a>
<span class="sourceLineNo">1604</span>     * Sets the renderer for the primary dataset and sends a<a name="line.1604"></a>
<span class="sourceLineNo">1605</span>     * {@link PlotChangeEvent} to all registered listeners.  If the renderer<a name="line.1605"></a>
<span class="sourceLineNo">1606</span>     * is set to &lt;code&gt;null&lt;/code&gt;, no data will be displayed.<a name="line.1606"></a>
<span class="sourceLineNo">1607</span>     *<a name="line.1607"></a>
<span class="sourceLineNo">1608</span>     * @param renderer  the renderer (&lt;code&gt;null&lt;/code&gt; permitted).<a name="line.1608"></a>
<span class="sourceLineNo">1609</span>     *<a name="line.1609"></a>
<span class="sourceLineNo">1610</span>     * @see #getRenderer()<a name="line.1610"></a>
<span class="sourceLineNo">1611</span>     */<a name="line.1611"></a>
<span class="sourceLineNo">1612</span>    public void setRenderer(XYItemRenderer renderer) {<a name="line.1612"></a>
<span class="sourceLineNo">1613</span>        setRenderer(0, renderer);<a name="line.1613"></a>
<span class="sourceLineNo">1614</span>    }<a name="line.1614"></a>
<span class="sourceLineNo">1615</span><a name="line.1615"></a>
<span class="sourceLineNo">1616</span>    /**<a name="line.1616"></a>
<span class="sourceLineNo">1617</span>     * Sets a renderer and sends a {@link PlotChangeEvent} to all<a name="line.1617"></a>
<span class="sourceLineNo">1618</span>     * registered listeners.<a name="line.1618"></a>
<span class="sourceLineNo">1619</span>     *<a name="line.1619"></a>
<span class="sourceLineNo">1620</span>     * @param index  the index.<a name="line.1620"></a>
<span class="sourceLineNo">1621</span>     * @param renderer  the renderer.<a name="line.1621"></a>
<span class="sourceLineNo">1622</span>     *<a name="line.1622"></a>
<span class="sourceLineNo">1623</span>     * @see #getRenderer(int)<a name="line.1623"></a>
<span class="sourceLineNo">1624</span>     */<a name="line.1624"></a>
<span class="sourceLineNo">1625</span>    public void setRenderer(int index, XYItemRenderer renderer) {<a name="line.1625"></a>
<span class="sourceLineNo">1626</span>        setRenderer(index, renderer, true);<a name="line.1626"></a>
<span class="sourceLineNo">1627</span>    }<a name="line.1627"></a>
<span class="sourceLineNo">1628</span><a name="line.1628"></a>
<span class="sourceLineNo">1629</span>    /**<a name="line.1629"></a>
<span class="sourceLineNo">1630</span>     * Sets a renderer and sends a {@link PlotChangeEvent} to all<a name="line.1630"></a>
<span class="sourceLineNo">1631</span>     * registered listeners.<a name="line.1631"></a>
<span class="sourceLineNo">1632</span>     *<a name="line.1632"></a>
<span class="sourceLineNo">1633</span>     * @param index  the index.<a name="line.1633"></a>
<span class="sourceLineNo">1634</span>     * @param renderer  the renderer.<a name="line.1634"></a>
<span class="sourceLineNo">1635</span>     * @param notify  notify listeners?<a name="line.1635"></a>
<span class="sourceLineNo">1636</span>     *<a name="line.1636"></a>
<span class="sourceLineNo">1637</span>     * @see #getRenderer(int)<a name="line.1637"></a>
<span class="sourceLineNo">1638</span>     */<a name="line.1638"></a>
<span class="sourceLineNo">1639</span>    public void setRenderer(int index, XYItemRenderer renderer,<a name="line.1639"></a>
<span class="sourceLineNo">1640</span>                            boolean notify) {<a name="line.1640"></a>
<span class="sourceLineNo">1641</span>        XYItemRenderer existing = getRenderer(index);<a name="line.1641"></a>
<span class="sourceLineNo">1642</span>        if (existing != null) {<a name="line.1642"></a>
<span class="sourceLineNo">1643</span>            existing.removeChangeListener(this);<a name="line.1643"></a>
<span class="sourceLineNo">1644</span>        }<a name="line.1644"></a>
<span class="sourceLineNo">1645</span>        this.renderers.set(index, renderer);<a name="line.1645"></a>
<span class="sourceLineNo">1646</span>        if (renderer != null) {<a name="line.1646"></a>
<span class="sourceLineNo">1647</span>            renderer.setPlot(this);<a name="line.1647"></a>
<span class="sourceLineNo">1648</span>            renderer.addChangeListener(this);<a name="line.1648"></a>
<span class="sourceLineNo">1649</span>        }<a name="line.1649"></a>
<span class="sourceLineNo">1650</span>        configureDomainAxes();<a name="line.1650"></a>
<span class="sourceLineNo">1651</span>        configureRangeAxes();<a name="line.1651"></a>
<span class="sourceLineNo">1652</span>        if (notify) {<a name="line.1652"></a>
<span class="sourceLineNo">1653</span>            fireChangeEvent();<a name="line.1653"></a>
<span class="sourceLineNo">1654</span>        }<a name="line.1654"></a>
<span class="sourceLineNo">1655</span>    }<a name="line.1655"></a>
<span class="sourceLineNo">1656</span><a name="line.1656"></a>
<span class="sourceLineNo">1657</span>    /**<a name="line.1657"></a>
<span class="sourceLineNo">1658</span>     * Sets the renderers for this plot and sends a {@link PlotChangeEvent}<a name="line.1658"></a>
<span class="sourceLineNo">1659</span>     * to all registered listeners.<a name="line.1659"></a>
<span class="sourceLineNo">1660</span>     *<a name="line.1660"></a>
<span class="sourceLineNo">1661</span>     * @param renderers  the renderers (&lt;code&gt;null&lt;/code&gt; not permitted).<a name="line.1661"></a>
<span class="sourceLineNo">1662</span>     */<a name="line.1662"></a>
<span class="sourceLineNo">1663</span>    public void setRenderers(XYItemRenderer[] renderers) {<a name="line.1663"></a>
<span class="sourceLineNo">1664</span>        for (int i = 0; i &lt; renderers.length; i++) {<a name="line.1664"></a>
<span class="sourceLineNo">1665</span>            setRenderer(i, renderers[i], false);<a name="line.1665"></a>
<span class="sourceLineNo">1666</span>        }<a name="line.1666"></a>
<span class="sourceLineNo">1667</span>        fireChangeEvent();<a name="line.1667"></a>
<span class="sourceLineNo">1668</span>    }<a name="line.1668"></a>
<span class="sourceLineNo">1669</span><a name="line.1669"></a>
<span class="sourceLineNo">1670</span>    /**<a name="line.1670"></a>
<span class="sourceLineNo">1671</span>     * Returns the dataset rendering order.<a name="line.1671"></a>
<span class="sourceLineNo">1672</span>     *<a name="line.1672"></a>
<span class="sourceLineNo">1673</span>     * @return The order (never &lt;code&gt;null&lt;/code&gt;).<a name="line.1673"></a>
<span class="sourceLineNo">1674</span>     *<a name="line.1674"></a>
<span class="sourceLineNo">1675</span>     * @see #setDatasetRenderingOrder(DatasetRenderingOrder)<a name="line.1675"></a>
<span class="sourceLineNo">1676</span>     */<a name="line.1676"></a>
<span class="sourceLineNo">1677</span>    public DatasetRenderingOrder getDatasetRenderingOrder() {<a name="line.1677"></a>
<span class="sourceLineNo">1678</span>        return this.datasetRenderingOrder;<a name="line.1678"></a>
<span class="sourceLineNo">1679</span>    }<a name="line.1679"></a>
<span class="sourceLineNo">1680</span><a name="line.1680"></a>
<span class="sourceLineNo">1681</span>    /**<a name="line.1681"></a>
<span class="sourceLineNo">1682</span>     * Sets the rendering order and sends a {@link PlotChangeEvent} to all<a name="line.1682"></a>
<span class="sourceLineNo">1683</span>     * registered listeners.  By default, the plot renders the primary dataset<a name="line.1683"></a>
<span class="sourceLineNo">1684</span>     * last (so that the primary dataset overlays the secondary datasets).<a name="line.1684"></a>
<span class="sourceLineNo">1685</span>     * You can reverse this if you want to.<a name="line.1685"></a>
<span class="sourceLineNo">1686</span>     *<a name="line.1686"></a>
<span class="sourceLineNo">1687</span>     * @param order  the rendering order (&lt;code&gt;null&lt;/code&gt; not permitted).<a name="line.1687"></a>
<span class="sourceLineNo">1688</span>     *<a name="line.1688"></a>
<span class="sourceLineNo">1689</span>     * @see #getDatasetRenderingOrder()<a name="line.1689"></a>
<span class="sourceLineNo">1690</span>     */<a name="line.1690"></a>
<span class="sourceLineNo">1691</span>    public void setDatasetRenderingOrder(DatasetRenderingOrder order) {<a name="line.1691"></a>
<span class="sourceLineNo">1692</span>        if (order == null) {<a name="line.1692"></a>
<span class="sourceLineNo">1693</span>            throw new IllegalArgumentException("Null 'order' argument.");<a name="line.1693"></a>
<span class="sourceLineNo">1694</span>        }<a name="line.1694"></a>
<span class="sourceLineNo">1695</span>        this.datasetRenderingOrder = order;<a name="line.1695"></a>
<span class="sourceLineNo">1696</span>        fireChangeEvent();<a name="line.1696"></a>
<span class="sourceLineNo">1697</span>    }<a name="line.1697"></a>
<span class="sourceLineNo">1698</span><a name="line.1698"></a>
<span class="sourceLineNo">1699</span>    /**<a name="line.1699"></a>
<span class="sourceLineNo">1700</span>     * Returns the series rendering order.<a name="line.1700"></a>
<span class="sourceLineNo">1701</span>     *<a name="line.1701"></a>
<span class="sourceLineNo">1702</span>     * @return the order (never &lt;code&gt;null&lt;/code&gt;).<a name="line.1702"></a>
<span class="sourceLineNo">1703</span>     *<a name="line.1703"></a>
<span class="sourceLineNo">1704</span>     * @see #setSeriesRenderingOrder(SeriesRenderingOrder)<a name="line.1704"></a>
<span class="sourceLineNo">1705</span>     */<a name="line.1705"></a>
<span class="sourceLineNo">1706</span>    public SeriesRenderingOrder getSeriesRenderingOrder() {<a name="line.1706"></a>
<span class="sourceLineNo">1707</span>        return this.seriesRenderingOrder;<a name="line.1707"></a>
<span class="sourceLineNo">1708</span>    }<a name="line.1708"></a>
<span class="sourceLineNo">1709</span><a name="line.1709"></a>
<span class="sourceLineNo">1710</span>    /**<a name="line.1710"></a>
<span class="sourceLineNo">1711</span>     * Sets the series order and sends a {@link PlotChangeEvent} to all<a name="line.1711"></a>
<span class="sourceLineNo">1712</span>     * registered listeners.  By default, the plot renders the primary series<a name="line.1712"></a>
<span class="sourceLineNo">1713</span>     * last (so that the primary series appears to be on top).<a name="line.1713"></a>
<span class="sourceLineNo">1714</span>     * You can reverse this if you want to.<a name="line.1714"></a>
<span class="sourceLineNo">1715</span>     *<a name="line.1715"></a>
<span class="sourceLineNo">1716</span>     * @param order  the rendering order (&lt;code&gt;null&lt;/code&gt; not permitted).<a name="line.1716"></a>
<span class="sourceLineNo">1717</span>     *<a name="line.1717"></a>
<span class="sourceLineNo">1718</span>     * @see #getSeriesRenderingOrder()<a name="line.1718"></a>
<span class="sourceLineNo">1719</span>     */<a name="line.1719"></a>
<span class="sourceLineNo">1720</span>    public void setSeriesRenderingOrder(SeriesRenderingOrder order) {<a name="line.1720"></a>
<span class="sourceLineNo">1721</span>        if (order == null) {<a name="line.1721"></a>
<span class="sourceLineNo">1722</span>            throw new IllegalArgumentException("Null 'order' argument.");<a name="line.1722"></a>
<span class="sourceLineNo">1723</span>        }<a name="line.1723"></a>
<span class="sourceLineNo">1724</span>        this.seriesRenderingOrder = order;<a name="line.1724"></a>
<span class="sourceLineNo">1725</span>        fireChangeEvent();<a name="line.1725"></a>
<span class="sourceLineNo">1726</span>    }<a name="line.1726"></a>
<span class="sourceLineNo">1727</span><a name="line.1727"></a>
<span class="sourceLineNo">1728</span>    /**<a name="line.1728"></a>
<span class="sourceLineNo">1729</span>     * Returns the index of the specified renderer, or &lt;code&gt;-1&lt;/code&gt; if the<a name="line.1729"></a>
<span class="sourceLineNo">1730</span>     * renderer is not assigned to this plot.<a name="line.1730"></a>
<span class="sourceLineNo">1731</span>     *<a name="line.1731"></a>
<span class="sourceLineNo">1732</span>     * @param renderer  the renderer (&lt;code&gt;null&lt;/code&gt; permitted).<a name="line.1732"></a>
<span class="sourceLineNo">1733</span>     *<a name="line.1733"></a>
<span class="sourceLineNo">1734</span>     * @return The renderer index.<a name="line.1734"></a>
<span class="sourceLineNo">1735</span>     */<a name="line.1735"></a>
<span class="sourceLineNo">1736</span>    public int getIndexOf(XYItemRenderer renderer) {<a name="line.1736"></a>
<span class="sourceLineNo">1737</span>        return this.renderers.indexOf(renderer);<a name="line.1737"></a>
<span class="sourceLineNo">1738</span>    }<a name="line.1738"></a>
<span class="sourceLineNo">1739</span><a name="line.1739"></a>
<span class="sourceLineNo">1740</span>    /**<a name="line.1740"></a>
<span class="sourceLineNo">1741</span>     * Returns the renderer for the specified dataset.  The code first<a name="line.1741"></a>
<span class="sourceLineNo">1742</span>     * determines the index of the dataset, then checks if there is a<a name="line.1742"></a>
<span class="sourceLineNo">1743</span>     * renderer with the same index (if not, the method returns renderer(0).<a name="line.1743"></a>
<span class="sourceLineNo">1744</span>     *<a name="line.1744"></a>
<span class="sourceLineNo">1745</span>     * @param dataset  the dataset (&lt;code&gt;null&lt;/code&gt; permitted).<a name="line.1745"></a>
<span class="sourceLineNo">1746</span>     *<a name="line.1746"></a>
<span class="sourceLineNo">1747</span>     * @return The renderer (possibly &lt;code&gt;null&lt;/code&gt;).<a name="line.1747"></a>
<span class="sourceLineNo">1748</span>     */<a name="line.1748"></a>
<span class="sourceLineNo">1749</span>    public XYItemRenderer getRendererForDataset(XYDataset dataset) {<a name="line.1749"></a>
<span class="sourceLineNo">1750</span>        XYItemRenderer result = null;<a name="line.1750"></a>
<span class="sourceLineNo">1751</span>        for (int i = 0; i &lt; this.datasets.size(); i++) {<a name="line.1751"></a>
<span class="sourceLineNo">1752</span>            if (this.datasets.get(i) == dataset) {<a name="line.1752"></a>
<span class="sourceLineNo">1753</span>                result = (XYItemRenderer) this.renderers.get(i);<a name="line.1753"></a>
<span class="sourceLineNo">1754</span>                if (result == null) {<a name="line.1754"></a>
<span class="sourceLineNo">1755</span>                    result = getRenderer();<a name="line.1755"></a>
<span class="sourceLineNo">1756</span>                }<a name="line.1756"></a>
<span class="sourceLineNo">1757</span>                break;<a name="line.1757"></a>
<span class="sourceLineNo">1758</span>            }<a name="line.1758"></a>
<span class="sourceLineNo">1759</span>        }<a name="line.1759"></a>
<span class="sourceLineNo">1760</span>        return result;<a name="line.1760"></a>
<span class="sourceLineNo">1761</span>    }<a name="line.1761"></a>
<span class="sourceLineNo">1762</span><a name="line.1762"></a>
<span class="sourceLineNo">1763</span>    /**<a name="line.1763"></a>
<span class="sourceLineNo">1764</span>     * Returns the weight for this plot when it is used as a subplot within a<a name="line.1764"></a>
<span class="sourceLineNo">1765</span>     * combined plot.<a name="line.1765"></a>
<span class="sourceLineNo">1766</span>     *<a name="line.1766"></a>
<span class="sourceLineNo">1767</span>     * @return The weight.<a name="line.1767"></a>
<span class="sourceLineNo">1768</span>     *<a name="line.1768"></a>
<span class="sourceLineNo">1769</span>     * @see #setWeight(int)<a name="line.1769"></a>
<span class="sourceLineNo">1770</span>     */<a name="line.1770"></a>
<span class="sourceLineNo">1771</span>    public int getWeight() {<a name="line.1771"></a>
<span class="sourceLineNo">1772</span>        return this.weight;<a name="line.1772"></a>
<span class="sourceLineNo">1773</span>    }<a name="line.1773"></a>
<span class="sourceLineNo">1774</span><a name="line.1774"></a>
<span class="sourceLineNo">1775</span>    /**<a name="line.1775"></a>
<span class="sourceLineNo">1776</span>     * Sets the weight for the plot and sends a {@link PlotChangeEvent} to all<a name="line.1776"></a>
<span class="sourceLineNo">1777</span>     * registered listeners.<a name="line.1777"></a>
<span class="sourceLineNo">1778</span>     *<a name="line.1778"></a>
<span class="sourceLineNo">1779</span>     * @param weight  the weight.<a name="line.1779"></a>
<span class="sourceLineNo">1780</span>     *<a name="line.1780"></a>
<span class="sourceLineNo">1781</span>     * @see #getWeight()<a name="line.1781"></a>
<span class="sourceLineNo">1782</span>     */<a name="line.1782"></a>
<span class="sourceLineNo">1783</span>    public void setWeight(int weight) {<a name="line.1783"></a>
<span class="sourceLineNo">1784</span>        this.weight = weight;<a name="line.1784"></a>
<span class="sourceLineNo">1785</span>        fireChangeEvent();<a name="line.1785"></a>
<span class="sourceLineNo">1786</span>    }<a name="line.1786"></a>
<span class="sourceLineNo">1787</span><a name="line.1787"></a>
<span class="sourceLineNo">1788</span>    /**<a name="line.1788"></a>
<span class="sourceLineNo">1789</span>     * Returns &lt;code&gt;true&lt;/code&gt; if the domain gridlines are visible, and<a name="line.1789"></a>
<span class="sourceLineNo">1790</span>     * &lt;code&gt;false&lt;/code&gt; otherwise.<a name="line.1790"></a>
<span class="sourceLineNo">1791</span>     *<a name="line.1791"></a>
<span class="sourceLineNo">1792</span>     * @return &lt;code&gt;true&lt;/code&gt; or &lt;code&gt;false&lt;/code&gt;.<a name="line.1792"></a>
<span class="sourceLineNo">1793</span>     *<a name="line.1793"></a>
<span class="sourceLineNo">1794</span>     * @see #setDomainGridlinesVisible(boolean)<a name="line.1794"></a>
<span class="sourceLineNo">1795</span>     */<a name="line.1795"></a>
<span class="sourceLineNo">1796</span>    public boolean isDomainGridlinesVisible() {<a name="line.1796"></a>
<span class="sourceLineNo">1797</span>        return this.domainGridlinesVisible;<a name="line.1797"></a>
<span class="sourceLineNo">1798</span>    }<a name="line.1798"></a>
<span class="sourceLineNo">1799</span><a name="line.1799"></a>
<span class="sourceLineNo">1800</span>    /**<a name="line.1800"></a>
<span class="sourceLineNo">1801</span>     * Sets the flag that controls whether or not the domain grid-lines are<a name="line.1801"></a>
<span class="sourceLineNo">1802</span>     * visible.<a name="line.1802"></a>
<span class="sourceLineNo">1803</span>     * &lt;p&gt;<a name="line.1803"></a>
<span class="sourceLineNo">1804</span>     * If the flag value is changed, a {@link PlotChangeEvent} is sent to all<a name="line.1804"></a>
<span class="sourceLineNo">1805</span>     * registered listeners.<a name="line.1805"></a>
<span class="sourceLineNo">1806</span>     *<a name="line.1806"></a>
<span class="sourceLineNo">1807</span>     * @param visible  the new value of the flag.<a name="line.1807"></a>
<span class="sourceLineNo">1808</span>     *<a name="line.1808"></a>
<span class="sourceLineNo">1809</span>     * @see #isDomainGridlinesVisible()<a name="line.1809"></a>
<span class="sourceLineNo">1810</span>     */<a name="line.1810"></a>
<span class="sourceLineNo">1811</span>    public void setDomainGridlinesVisible(boolean visible) {<a name="line.1811"></a>
<span class="sourceLineNo">1812</span>        if (this.domainGridlinesVisible != visible) {<a name="line.1812"></a>
<span class="sourceLineNo">1813</span>            this.domainGridlinesVisible = visible;<a name="line.1813"></a>
<span class="sourceLineNo">1814</span>            fireChangeEvent();<a name="line.1814"></a>
<span class="sourceLineNo">1815</span>        }<a name="line.1815"></a>
<span class="sourceLineNo">1816</span>    }<a name="line.1816"></a>
<span class="sourceLineNo">1817</span><a name="line.1817"></a>
<span class="sourceLineNo">1818</span>    /**<a name="line.1818"></a>
<span class="sourceLineNo">1819</span>     * Returns &lt;code&gt;true&lt;/code&gt; if the domain minor gridlines are visible, and<a name="line.1819"></a>
<span class="sourceLineNo">1820</span>     * &lt;code&gt;false&lt;/code&gt; otherwise.<a name="line.1820"></a>
<span class="sourceLineNo">1821</span>     *<a name="line.1821"></a>
<span class="sourceLineNo">1822</span>     * @return &lt;code&gt;true&lt;/code&gt; or &lt;code&gt;false&lt;/code&gt;.<a name="line.1822"></a>
<span class="sourceLineNo">1823</span>     *<a name="line.1823"></a>
<span class="sourceLineNo">1824</span>     * @see #setDomainMinorGridlinesVisible(boolean)<a name="line.1824"></a>
<span class="sourceLineNo">1825</span>     *<a name="line.1825"></a>
<span class="sourceLineNo">1826</span>     * @since 1.0.12<a name="line.1826"></a>
<span class="sourceLineNo">1827</span>     */<a name="line.1827"></a>
<span class="sourceLineNo">1828</span>    public boolean isDomainMinorGridlinesVisible() {<a name="line.1828"></a>
<span class="sourceLineNo">1829</span>        return this.domainMinorGridlinesVisible;<a name="line.1829"></a>
<span class="sourceLineNo">1830</span>    }<a name="line.1830"></a>
<span class="sourceLineNo">1831</span><a name="line.1831"></a>
<span class="sourceLineNo">1832</span>    /**<a name="line.1832"></a>
<span class="sourceLineNo">1833</span>     * Sets the flag that controls whether or not the domain minor grid-lines<a name="line.1833"></a>
<span class="sourceLineNo">1834</span>     * are visible.<a name="line.1834"></a>
<span class="sourceLineNo">1835</span>     * &lt;p&gt;<a name="line.1835"></a>
<span class="sourceLineNo">1836</span>     * If the flag value is changed, a {@link PlotChangeEvent} is sent to all<a name="line.1836"></a>
<span class="sourceLineNo">1837</span>     * registered listeners.<a name="line.1837"></a>
<span class="sourceLineNo">1838</span>     *<a name="line.1838"></a>
<span class="sourceLineNo">1839</span>     * @param visible  the new value of the flag.<a name="line.1839"></a>
<span class="sourceLineNo">1840</span>     *<a name="line.1840"></a>
<span class="sourceLineNo">1841</span>     * @see #isDomainMinorGridlinesVisible()<a name="line.1841"></a>
<span class="sourceLineNo">1842</span>     *<a name="line.1842"></a>
<span class="sourceLineNo">1843</span>     * @since 1.0.12<a name="line.1843"></a>
<span class="sourceLineNo">1844</span>     */<a name="line.1844"></a>
<span class="sourceLineNo">1845</span>    public void setDomainMinorGridlinesVisible(boolean visible) {<a name="line.1845"></a>
<span class="sourceLineNo">1846</span>        if (this.domainMinorGridlinesVisible != visible) {<a name="line.1846"></a>
<span class="sourceLineNo">1847</span>            this.domainMinorGridlinesVisible = visible;<a name="line.1847"></a>
<span class="sourceLineNo">1848</span>            fireChangeEvent();<a name="line.1848"></a>
<span class="sourceLineNo">1849</span>        }<a name="line.1849"></a>
<span class="sourceLineNo">1850</span>    }<a name="line.1850"></a>
<span class="sourceLineNo">1851</span><a name="line.1851"></a>
<span class="sourceLineNo">1852</span>    /**<a name="line.1852"></a>
<span class="sourceLineNo">1853</span>     * Returns the stroke for the grid-lines (if any) plotted against the<a name="line.1853"></a>
<span class="sourceLineNo">1854</span>     * domain axis.<a name="line.1854"></a>
<span class="sourceLineNo">1855</span>     *<a name="line.1855"></a>
<span class="sourceLineNo">1856</span>     * @return The stroke (never &lt;code&gt;null&lt;/code&gt;).<a name="line.1856"></a>
<span class="sourceLineNo">1857</span>     *<a name="line.1857"></a>
<span class="sourceLineNo">1858</span>     * @see #setDomainGridlineStroke(Stroke)<a name="line.1858"></a>
<span class="sourceLineNo">1859</span>     */<a name="line.1859"></a>
<span class="sourceLineNo">1860</span>    public Stroke getDomainGridlineStroke() {<a name="line.1860"></a>
<span class="sourceLineNo">1861</span>        return this.domainGridlineStroke;<a name="line.1861"></a>
<span class="sourceLineNo">1862</span>    }<a name="line.1862"></a>
<span class="sourceLineNo">1863</span><a name="line.1863"></a>
<span class="sourceLineNo">1864</span>    /**<a name="line.1864"></a>
<span class="sourceLineNo">1865</span>     * Sets the stroke for the grid lines plotted against the domain axis, and<a name="line.1865"></a>
<span class="sourceLineNo">1866</span>     * sends a {@link PlotChangeEvent} to all registered listeners.<a name="line.1866"></a>
<span class="sourceLineNo">1867</span>     *<a name="line.1867"></a>
<span class="sourceLineNo">1868</span>     * @param stroke  the stroke (&lt;code&gt;null&lt;/code&gt; not permitted).<a name="line.1868"></a>
<span class="sourceLineNo">1869</span>     *<a name="line.1869"></a>
<span class="sourceLineNo">1870</span>     * @throws IllegalArgumentException if &lt;code&gt;stroke&lt;/code&gt; is<a name="line.1870"></a>
<span class="sourceLineNo">1871</span>     *     &lt;code&gt;null&lt;/code&gt;.<a name="line.1871"></a>
<span class="sourceLineNo">1872</span>     *<a name="line.1872"></a>
<span class="sourceLineNo">1873</span>     * @see #getDomainGridlineStroke()<a name="line.1873"></a>
<span class="sourceLineNo">1874</span>     */<a name="line.1874"></a>
<span class="sourceLineNo">1875</span>    public void setDomainGridlineStroke(Stroke stroke) {<a name="line.1875"></a>
<span class="sourceLineNo">1876</span>        if (stroke == null) {<a name="line.1876"></a>
<span class="sourceLineNo">1877</span>            throw new IllegalArgumentException("Null 'stroke' argument.");<a name="line.1877"></a>
<span class="sourceLineNo">1878</span>        }<a name="line.1878"></a>
<span class="sourceLineNo">1879</span>        this.domainGridlineStroke = stroke;<a name="line.1879"></a>
<span class="sourceLineNo">1880</span>        fireChangeEvent();<a name="line.1880"></a>
<span class="sourceLineNo">1881</span>    }<a name="line.1881"></a>
<span class="sourceLineNo">1882</span><a name="line.1882"></a>
<span class="sourceLineNo">1883</span>    /**<a name="line.1883"></a>
<span class="sourceLineNo">1884</span>     * Returns the stroke for the minor grid-lines (if any) plotted against the<a name="line.1884"></a>
<span class="sourceLineNo">1885</span>     * domain axis.<a name="line.1885"></a>
<span class="sourceLineNo">1886</span>     *<a name="line.1886"></a>
<span class="sourceLineNo">1887</span>     * @return The stroke (never &lt;code&gt;null&lt;/code&gt;).<a name="line.1887"></a>
<span class="sourceLineNo">1888</span>     *<a name="line.1888"></a>
<span class="sourceLineNo">1889</span>     * @see #setDomainMinorGridlineStroke(Stroke)<a name="line.1889"></a>
<span class="sourceLineNo">1890</span>     *<a name="line.1890"></a>
<span class="sourceLineNo">1891</span>     * @since 1.0.12<a name="line.1891"></a>
<span class="sourceLineNo">1892</span>     */<a name="line.1892"></a>
<span class="sourceLineNo">1893</span><a name="line.1893"></a>
<span class="sourceLineNo">1894</span>    public Stroke getDomainMinorGridlineStroke() {<a name="line.1894"></a>
<span class="sourceLineNo">1895</span>        return this.domainMinorGridlineStroke;<a name="line.1895"></a>
<span class="sourceLineNo">1896</span>    }<a name="line.1896"></a>
<span class="sourceLineNo">1897</span><a name="line.1897"></a>
<span class="sourceLineNo">1898</span>    /**<a name="line.1898"></a>
<span class="sourceLineNo">1899</span>     * Sets the stroke for the minor grid lines plotted against the domain<a name="line.1899"></a>
<span class="sourceLineNo">1900</span>     * axis, and sends a {@link PlotChangeEvent} to all registered listeners.<a name="line.1900"></a>
<span class="sourceLineNo">1901</span>     *<a name="line.1901"></a>
<span class="sourceLineNo">1902</span>     * @param stroke  the stroke (&lt;code&gt;null&lt;/code&gt; not permitted).<a name="line.1902"></a>
<span class="sourceLineNo">1903</span>     *<a name="line.1903"></a>
<span class="sourceLineNo">1904</span>     * @throws IllegalArgumentException if &lt;code&gt;stroke&lt;/code&gt; is<a name="line.1904"></a>
<span class="sourceLineNo">1905</span>     *     &lt;code&gt;null&lt;/code&gt;.<a name="line.1905"></a>
<span class="sourceLineNo">1906</span>     *<a name="line.1906"></a>
<span class="sourceLineNo">1907</span>     * @see #getDomainMinorGridlineStroke()<a name="line.1907"></a>
<span class="sourceLineNo">1908</span>     *<a name="line.1908"></a>
<span class="sourceLineNo">1909</span>     * @since 1.0.12<a name="line.1909"></a>
<span class="sourceLineNo">1910</span>     */<a name="line.1910"></a>
<span class="sourceLineNo">1911</span>    public void setDomainMinorGridlineStroke(Stroke stroke) {<a name="line.1911"></a>
<span class="sourceLineNo">1912</span>        if (stroke == null) {<a name="line.1912"></a>
<span class="sourceLineNo">1913</span>            throw new IllegalArgumentException("Null 'stroke' argument.");<a name="line.1913"></a>
<span class="sourceLineNo">1914</span>        }<a name="line.1914"></a>
<span class="sourceLineNo">1915</span>        this.domainMinorGridlineStroke = stroke;<a name="line.1915"></a>
<span class="sourceLineNo">1916</span>        fireChangeEvent();<a name="line.1916"></a>
<span class="sourceLineNo">1917</span>    }<a name="line.1917"></a>
<span class="sourceLineNo">1918</span><a name="line.1918"></a>
<span class="sourceLineNo">1919</span>    /**<a name="line.1919"></a>
<span class="sourceLineNo">1920</span>     * Returns the paint for the grid lines (if any) plotted against the domain<a name="line.1920"></a>
<span class="sourceLineNo">1921</span>     * axis.<a name="line.1921"></a>
<span class="sourceLineNo">1922</span>     *<a name="line.1922"></a>
<span class="sourceLineNo">1923</span>     * @return The paint (never &lt;code&gt;null&lt;/code&gt;).<a name="line.1923"></a>
<span class="sourceLineNo">1924</span>     *<a name="line.1924"></a>
<span class="sourceLineNo">1925</span>     * @see #setDomainGridlinePaint(Paint)<a name="line.1925"></a>
<span class="sourceLineNo">1926</span>     */<a name="line.1926"></a>
<span class="sourceLineNo">1927</span>    public Paint getDomainGridlinePaint() {<a name="line.1927"></a>
<span class="sourceLineNo">1928</span>        return this.domainGridlinePaint;<a name="line.1928"></a>
<span class="sourceLineNo">1929</span>    }<a name="line.1929"></a>
<span class="sourceLineNo">1930</span><a name="line.1930"></a>
<span class="sourceLineNo">1931</span>    /**<a name="line.1931"></a>
<span class="sourceLineNo">1932</span>     * Sets the paint for the grid lines plotted against the domain axis, and<a name="line.1932"></a>
<span class="sourceLineNo">1933</span>     * sends a {@link PlotChangeEvent} to all registered listeners.<a name="line.1933"></a>
<span class="sourceLineNo">1934</span>     *<a name="line.1934"></a>
<span class="sourceLineNo">1935</span>     * @param paint  the paint (&lt;code&gt;null&lt;/code&gt; not permitted).<a name="line.1935"></a>
<span class="sourceLineNo">1936</span>     *<a name="line.1936"></a>
<span class="sourceLineNo">1937</span>     * @throws IllegalArgumentException if &lt;code&gt;paint&lt;/code&gt; is<a name="line.1937"></a>
<span class="sourceLineNo">1938</span>     *     &lt;code&gt;null&lt;/code&gt;.<a name="line.1938"></a>
<span class="sourceLineNo">1939</span>     *<a name="line.1939"></a>
<span class="sourceLineNo">1940</span>     * @see #getDomainGridlinePaint()<a name="line.1940"></a>
<span class="sourceLineNo">1941</span>     */<a name="line.1941"></a>
<span class="sourceLineNo">1942</span>    public void setDomainGridlinePaint(Paint paint) {<a name="line.1942"></a>
<span class="sourceLineNo">1943</span>        if (paint == null) {<a name="line.1943"></a>
<span class="sourceLineNo">1944</span>            throw new IllegalArgumentException("Null 'paint' argument.");<a name="line.1944"></a>
<span class="sourceLineNo">1945</span>        }<a name="line.1945"></a>
<span class="sourceLineNo">1946</span>        this.domainGridlinePaint = paint;<a name="line.1946"></a>
<span class="sourceLineNo">1947</span>        fireChangeEvent();<a name="line.1947"></a>
<span class="sourceLineNo">1948</span>    }<a name="line.1948"></a>
<span class="sourceLineNo">1949</span><a name="line.1949"></a>
<span class="sourceLineNo">1950</span>    /**<a name="line.1950"></a>
<span class="sourceLineNo">1951</span>     * Returns the paint for the minor grid lines (if any) plotted against the<a name="line.1951"></a>
<span class="sourceLineNo">1952</span>     * domain axis.<a name="line.1952"></a>
<span class="sourceLineNo">1953</span>     *<a name="line.1953"></a>
<span class="sourceLineNo">1954</span>     * @return The paint (never &lt;code&gt;null&lt;/code&gt;).<a name="line.1954"></a>
<span class="sourceLineNo">1955</span>     *<a name="line.1955"></a>
<span class="sourceLineNo">1956</span>     * @see #setDomainMinorGridlinePaint(Paint)<a name="line.1956"></a>
<span class="sourceLineNo">1957</span>     *<a name="line.1957"></a>
<span class="sourceLineNo">1958</span>     * @since 1.0.12<a name="line.1958"></a>
<span class="sourceLineNo">1959</span>     */<a name="line.1959"></a>
<span class="sourceLineNo">1960</span>    public Paint getDomainMinorGridlinePaint() {<a name="line.1960"></a>
<span class="sourceLineNo">1961</span>        return this.domainMinorGridlinePaint;<a name="line.1961"></a>
<span class="sourceLineNo">1962</span>    }<a name="line.1962"></a>
<span class="sourceLineNo">1963</span><a name="line.1963"></a>
<span class="sourceLineNo">1964</span>    /**<a name="line.1964"></a>
<span class="sourceLineNo">1965</span>     * Sets the paint for the minor grid lines plotted against the domain axis,<a name="line.1965"></a>
<span class="sourceLineNo">1966</span>     * and sends a {@link PlotChangeEvent} to all registered listeners.<a name="line.1966"></a>
<span class="sourceLineNo">1967</span>     *<a name="line.1967"></a>
<span class="sourceLineNo">1968</span>     * @param paint  the paint (&lt;code&gt;null&lt;/code&gt; not permitted).<a name="line.1968"></a>
<span class="sourceLineNo">1969</span>     *<a name="line.1969"></a>
<span class="sourceLineNo">1970</span>     * @throws IllegalArgumentException if &lt;code&gt;paint&lt;/code&gt; is<a name="line.1970"></a>
<span class="sourceLineNo">1971</span>     *     &lt;code&gt;null&lt;/code&gt;.<a name="line.1971"></a>
<span class="sourceLineNo">1972</span>     *<a name="line.1972"></a>
<span class="sourceLineNo">1973</span>     * @see #getDomainMinorGridlinePaint()<a name="line.1973"></a>
<span class="sourceLineNo">1974</span>     *<a name="line.1974"></a>
<span class="sourceLineNo">1975</span>     * @since 1.0.12<a name="line.1975"></a>
<span class="sourceLineNo">1976</span>     */<a name="line.1976"></a>
<span class="sourceLineNo">1977</span>    public void setDomainMinorGridlinePaint(Paint paint) {<a name="line.1977"></a>
<span class="sourceLineNo">1978</span>        if (paint == null) {<a name="line.1978"></a>
<span class="sourceLineNo">1979</span>            throw new IllegalArgumentException("Null 'paint' argument.");<a name="line.1979"></a>
<span class="sourceLineNo">1980</span>        }<a name="line.1980"></a>
<span class="sourceLineNo">1981</span>        this.domainMinorGridlinePaint = paint;<a name="line.1981"></a>
<span class="sourceLineNo">1982</span>        fireChangeEvent();<a name="line.1982"></a>
<span class="sourceLineNo">1983</span>    }<a name="line.1983"></a>
<span class="sourceLineNo">1984</span><a name="line.1984"></a>
<span class="sourceLineNo">1985</span>    /**<a name="line.1985"></a>
<span class="sourceLineNo">1986</span>     * Returns &lt;code&gt;true&lt;/code&gt; if the range axis grid is visible, and<a name="line.1986"></a>
<span class="sourceLineNo">1987</span>     * &lt;code&gt;false&lt;/code&gt; otherwise.<a name="line.1987"></a>
<span class="sourceLineNo">1988</span>     *<a name="line.1988"></a>
<span class="sourceLineNo">1989</span>     * @return A boolean.<a name="line.1989"></a>
<span class="sourceLineNo">1990</span>     *<a name="line.1990"></a>
<span class="sourceLineNo">1991</span>     * @see #setRangeGridlinesVisible(boolean)<a name="line.1991"></a>
<span class="sourceLineNo">1992</span>     */<a name="line.1992"></a>
<span class="sourceLineNo">1993</span>    public boolean isRangeGridlinesVisible() {<a name="line.1993"></a>
<span class="sourceLineNo">1994</span>        return this.rangeGridlinesVisible;<a name="line.1994"></a>
<span class="sourceLineNo">1995</span>    }<a name="line.1995"></a>
<span class="sourceLineNo">1996</span><a name="line.1996"></a>
<span class="sourceLineNo">1997</span>    /**<a name="line.1997"></a>
<span class="sourceLineNo">1998</span>     * Sets the flag that controls whether or not the range axis grid lines<a name="line.1998"></a>
<span class="sourceLineNo">1999</span>     * are visible.<a name="line.1999"></a>
<span class="sourceLineNo">2000</span>     * &lt;p&gt;<a name="line.2000"></a>
<span class="sourceLineNo">2001</span>     * If the flag value is changed, a {@link PlotChangeEvent} is sent to all<a name="line.2001"></a>
<span class="sourceLineNo">2002</span>     * registered listeners.<a name="line.2002"></a>
<span class="sourceLineNo">2003</span>     *<a name="line.2003"></a>
<span class="sourceLineNo">2004</span>     * @param visible  the new value of the flag.<a name="line.2004"></a>
<span class="sourceLineNo">2005</span>     *<a name="line.2005"></a>
<span class="sourceLineNo">2006</span>     * @see #isRangeGridlinesVisible()<a name="line.2006"></a>
<span class="sourceLineNo">2007</span>     */<a name="line.2007"></a>
<span class="sourceLineNo">2008</span>    public void setRangeGridlinesVisible(boolean visible) {<a name="line.2008"></a>
<span class="sourceLineNo">2009</span>        if (this.rangeGridlinesVisible != visible) {<a name="line.2009"></a>
<span class="sourceLineNo">2010</span>            this.rangeGridlinesVisible = visible;<a name="line.2010"></a>
<span class="sourceLineNo">2011</span>            fireChangeEvent();<a name="line.2011"></a>
<span class="sourceLineNo">2012</span>        }<a name="line.2012"></a>
<span class="sourceLineNo">2013</span>    }<a name="line.2013"></a>
<span class="sourceLineNo">2014</span><a name="line.2014"></a>
<span class="sourceLineNo">2015</span>    /**<a name="line.2015"></a>
<span class="sourceLineNo">2016</span>     * Returns the stroke for the grid lines (if any) plotted against the<a name="line.2016"></a>
<span class="sourceLineNo">2017</span>     * range axis.<a name="line.2017"></a>
<span class="sourceLineNo">2018</span>     *<a name="line.2018"></a>
<span class="sourceLineNo">2019</span>     * @return The stroke (never &lt;code&gt;null&lt;/code&gt;).<a name="line.2019"></a>
<span class="sourceLineNo">2020</span>     *<a name="line.2020"></a>
<span class="sourceLineNo">2021</span>     * @see #setRangeGridlineStroke(Stroke)<a name="line.2021"></a>
<span class="sourceLineNo">2022</span>     */<a name="line.2022"></a>
<span class="sourceLineNo">2023</span>    public Stroke getRangeGridlineStroke() {<a name="line.2023"></a>
<span class="sourceLineNo">2024</span>        return this.rangeGridlineStroke;<a name="line.2024"></a>
<span class="sourceLineNo">2025</span>    }<a name="line.2025"></a>
<span class="sourceLineNo">2026</span><a name="line.2026"></a>
<span class="sourceLineNo">2027</span>    /**<a name="line.2027"></a>
<span class="sourceLineNo">2028</span>     * Sets the stroke for the grid lines plotted against the range axis,<a name="line.2028"></a>
<span class="sourceLineNo">2029</span>     * and sends a {@link PlotChangeEvent} to all registered listeners.<a name="line.2029"></a>
<span class="sourceLineNo">2030</span>     *<a name="line.2030"></a>
<span class="sourceLineNo">2031</span>     * @param stroke  the stroke (&lt;code&gt;null&lt;/code&gt; not permitted).<a name="line.2031"></a>
<span class="sourceLineNo">2032</span>     *<a name="line.2032"></a>
<span class="sourceLineNo">2033</span>     * @see #getRangeGridlineStroke()<a name="line.2033"></a>
<span class="sourceLineNo">2034</span>     */<a name="line.2034"></a>
<span class="sourceLineNo">2035</span>    public void setRangeGridlineStroke(Stroke stroke) {<a name="line.2035"></a>
<span class="sourceLineNo">2036</span>        if (stroke == null) {<a name="line.2036"></a>
<span class="sourceLineNo">2037</span>            throw new IllegalArgumentException("Null 'stroke' argument.");<a name="line.2037"></a>
<span class="sourceLineNo">2038</span>        }<a name="line.2038"></a>
<span class="sourceLineNo">2039</span>        this.rangeGridlineStroke = stroke;<a name="line.2039"></a>
<span class="sourceLineNo">2040</span>        fireChangeEvent();<a name="line.2040"></a>
<span class="sourceLineNo">2041</span>    }<a name="line.2041"></a>
<span class="sourceLineNo">2042</span><a name="line.2042"></a>
<span class="sourceLineNo">2043</span>    /**<a name="line.2043"></a>
<span class="sourceLineNo">2044</span>     * Returns the paint for the grid lines (if any) plotted against the range<a name="line.2044"></a>
<span class="sourceLineNo">2045</span>     * axis.<a name="line.2045"></a>
<span class="sourceLineNo">2046</span>     *<a name="line.2046"></a>
<span class="sourceLineNo">2047</span>     * @return The paint (never &lt;code&gt;null&lt;/code&gt;).<a name="line.2047"></a>
<span class="sourceLineNo">2048</span>     *<a name="line.2048"></a>
<span class="sourceLineNo">2049</span>     * @see #setRangeGridlinePaint(Paint)<a name="line.2049"></a>
<span class="sourceLineNo">2050</span>     */<a name="line.2050"></a>
<span class="sourceLineNo">2051</span>    public Paint getRangeGridlinePaint() {<a name="line.2051"></a>
<span class="sourceLineNo">2052</span>        return this.rangeGridlinePaint;<a name="line.2052"></a>
<span class="sourceLineNo">2053</span>    }<a name="line.2053"></a>
<span class="sourceLineNo">2054</span><a name="line.2054"></a>
<span class="sourceLineNo">2055</span>    /**<a name="line.2055"></a>
<span class="sourceLineNo">2056</span>     * Sets the paint for the grid lines plotted against the range axis and<a name="line.2056"></a>
<span class="sourceLineNo">2057</span>     * sends a {@link PlotChangeEvent} to all registered listeners.<a name="line.2057"></a>
<span class="sourceLineNo">2058</span>     *<a name="line.2058"></a>
<span class="sourceLineNo">2059</span>     * @param paint  the paint (&lt;code&gt;null&lt;/code&gt; not permitted).<a name="line.2059"></a>
<span class="sourceLineNo">2060</span>     *<a name="line.2060"></a>
<span class="sourceLineNo">2061</span>     * @see #getRangeGridlinePaint()<a name="line.2061"></a>
<span class="sourceLineNo">2062</span>     */<a name="line.2062"></a>
<span class="sourceLineNo">2063</span>    public void setRangeGridlinePaint(Paint paint) {<a name="line.2063"></a>
<span class="sourceLineNo">2064</span>        if (paint == null) {<a name="line.2064"></a>
<span class="sourceLineNo">2065</span>            throw new IllegalArgumentException("Null 'paint' argument.");<a name="line.2065"></a>
<span class="sourceLineNo">2066</span>        }<a name="line.2066"></a>
<span class="sourceLineNo">2067</span>        this.rangeGridlinePaint = paint;<a name="line.2067"></a>
<span class="sourceLineNo">2068</span>        fireChangeEvent();<a name="line.2068"></a>
<span class="sourceLineNo">2069</span>    }<a name="line.2069"></a>
<span class="sourceLineNo">2070</span><a name="line.2070"></a>
<span class="sourceLineNo">2071</span>    /**<a name="line.2071"></a>
<span class="sourceLineNo">2072</span>     * Returns &lt;code&gt;true&lt;/code&gt; if the range axis minor grid is visible, and<a name="line.2072"></a>
<span class="sourceLineNo">2073</span>     * &lt;code&gt;false&lt;/code&gt; otherwise.<a name="line.2073"></a>
<span class="sourceLineNo">2074</span>     *<a name="line.2074"></a>
<span class="sourceLineNo">2075</span>     * @return A boolean.<a name="line.2075"></a>
<span class="sourceLineNo">2076</span>     *<a name="line.2076"></a>
<span class="sourceLineNo">2077</span>     * @see #setRangeMinorGridlinesVisible(boolean)<a name="line.2077"></a>
<span class="sourceLineNo">2078</span>     *<a name="line.2078"></a>
<span class="sourceLineNo">2079</span>     * @since 1.0.12<a name="line.2079"></a>
<span class="sourceLineNo">2080</span>     */<a name="line.2080"></a>
<span class="sourceLineNo">2081</span>    public boolean isRangeMinorGridlinesVisible() {<a name="line.2081"></a>
<span class="sourceLineNo">2082</span>        return this.rangeMinorGridlinesVisible;<a name="line.2082"></a>
<span class="sourceLineNo">2083</span>    }<a name="line.2083"></a>
<span class="sourceLineNo">2084</span><a name="line.2084"></a>
<span class="sourceLineNo">2085</span>    /**<a name="line.2085"></a>
<span class="sourceLineNo">2086</span>     * Sets the flag that controls whether or not the range axis minor grid<a name="line.2086"></a>
<span class="sourceLineNo">2087</span>     * lines are visible.<a name="line.2087"></a>
<span class="sourceLineNo">2088</span>     * &lt;p&gt;<a name="line.2088"></a>
<span class="sourceLineNo">2089</span>     * If the flag value is changed, a {@link PlotChangeEvent} is sent to all<a name="line.2089"></a>
<span class="sourceLineNo">2090</span>     * registered listeners.<a name="line.2090"></a>
<span class="sourceLineNo">2091</span>     *<a name="line.2091"></a>
<span class="sourceLineNo">2092</span>     * @param visible  the new value of the flag.<a name="line.2092"></a>
<span class="sourceLineNo">2093</span>     *<a name="line.2093"></a>
<span class="sourceLineNo">2094</span>     * @see #isRangeMinorGridlinesVisible()<a name="line.2094"></a>
<span class="sourceLineNo">2095</span>     *<a name="line.2095"></a>
<span class="sourceLineNo">2096</span>     * @since 1.0.12<a name="line.2096"></a>
<span class="sourceLineNo">2097</span>     */<a name="line.2097"></a>
<span class="sourceLineNo">2098</span>    public void setRangeMinorGridlinesVisible(boolean visible) {<a name="line.2098"></a>
<span class="sourceLineNo">2099</span>        if (this.rangeMinorGridlinesVisible != visible) {<a name="line.2099"></a>
<span class="sourceLineNo">2100</span>            this.rangeMinorGridlinesVisible = visible;<a name="line.2100"></a>
<span class="sourceLineNo">2101</span>            fireChangeEvent();<a name="line.2101"></a>
<span class="sourceLineNo">2102</span>        }<a name="line.2102"></a>
<span class="sourceLineNo">2103</span>    }<a name="line.2103"></a>
<span class="sourceLineNo">2104</span><a name="line.2104"></a>
<span class="sourceLineNo">2105</span>    /**<a name="line.2105"></a>
<span class="sourceLineNo">2106</span>     * Returns the stroke for the minor grid lines (if any) plotted against the<a name="line.2106"></a>
<span class="sourceLineNo">2107</span>     * range axis.<a name="line.2107"></a>
<span class="sourceLineNo">2108</span>     *<a name="line.2108"></a>
<span class="sourceLineNo">2109</span>     * @return The stroke (never &lt;code&gt;null&lt;/code&gt;).<a name="line.2109"></a>
<span class="sourceLineNo">2110</span>     *<a name="line.2110"></a>
<span class="sourceLineNo">2111</span>     * @see #setRangeMinorGridlineStroke(Stroke)<a name="line.2111"></a>
<span class="sourceLineNo">2112</span>     *<a name="line.2112"></a>
<span class="sourceLineNo">2113</span>     * @since 1.0.12<a name="line.2113"></a>
<span class="sourceLineNo">2114</span>     */<a name="line.2114"></a>
<span class="sourceLineNo">2115</span>    public Stroke getRangeMinorGridlineStroke() {<a name="line.2115"></a>
<span class="sourceLineNo">2116</span>        return this.rangeMinorGridlineStroke;<a name="line.2116"></a>
<span class="sourceLineNo">2117</span>    }<a name="line.2117"></a>
<span class="sourceLineNo">2118</span><a name="line.2118"></a>
<span class="sourceLineNo">2119</span>    /**<a name="line.2119"></a>
<span class="sourceLineNo">2120</span>     * Sets the stroke for the minor grid lines plotted against the range axis,<a name="line.2120"></a>
<span class="sourceLineNo">2121</span>     * and sends a {@link PlotChangeEvent} to all registered listeners.<a name="line.2121"></a>
<span class="sourceLineNo">2122</span>     *<a name="line.2122"></a>
<span class="sourceLineNo">2123</span>     * @param stroke  the stroke (&lt;code&gt;null&lt;/code&gt; not permitted).<a name="line.2123"></a>
<span class="sourceLineNo">2124</span>     *<a name="line.2124"></a>
<span class="sourceLineNo">2125</span>     * @see #getRangeMinorGridlineStroke()<a name="line.2125"></a>
<span class="sourceLineNo">2126</span>     *<a name="line.2126"></a>
<span class="sourceLineNo">2127</span>     * @since 1.0.12<a name="line.2127"></a>
<span class="sourceLineNo">2128</span>     */<a name="line.2128"></a>
<span class="sourceLineNo">2129</span>    public void setRangeMinorGridlineStroke(Stroke stroke) {<a name="line.2129"></a>
<span class="sourceLineNo">2130</span>        if (stroke == null) {<a name="line.2130"></a>
<span class="sourceLineNo">2131</span>            throw new IllegalArgumentException("Null 'stroke' argument.");<a name="line.2131"></a>
<span class="sourceLineNo">2132</span>        }<a name="line.2132"></a>
<span class="sourceLineNo">2133</span>        this.rangeMinorGridlineStroke = stroke;<a name="line.2133"></a>
<span class="sourceLineNo">2134</span>        fireChangeEvent();<a name="line.2134"></a>
<span class="sourceLineNo">2135</span>    }<a name="line.2135"></a>
<span class="sourceLineNo">2136</span><a name="line.2136"></a>
<span class="sourceLineNo">2137</span>    /**<a name="line.2137"></a>
<span class="sourceLineNo">2138</span>     * Returns the paint for the minor grid lines (if any) plotted against the <a name="line.2138"></a>
<span class="sourceLineNo">2139</span>     * range axis.<a name="line.2139"></a>
<span class="sourceLineNo">2140</span>     *<a name="line.2140"></a>
<span class="sourceLineNo">2141</span>     * @return The paint (never &lt;code&gt;null&lt;/code&gt;).<a name="line.2141"></a>
<span class="sourceLineNo">2142</span>     *<a name="line.2142"></a>
<span class="sourceLineNo">2143</span>     * @see #setRangeMinorGridlinePaint(Paint)<a name="line.2143"></a>
<span class="sourceLineNo">2144</span>     *<a name="line.2144"></a>
<span class="sourceLineNo">2145</span>     * @since 1.0.12<a name="line.2145"></a>
<span class="sourceLineNo">2146</span>     */<a name="line.2146"></a>
<span class="sourceLineNo">2147</span>    public Paint getRangeMinorGridlinePaint() {<a name="line.2147"></a>
<span class="sourceLineNo">2148</span>        return this.rangeMinorGridlinePaint;<a name="line.2148"></a>
<span class="sourceLineNo">2149</span>    }<a name="line.2149"></a>
<span class="sourceLineNo">2150</span><a name="line.2150"></a>
<span class="sourceLineNo">2151</span>    /**<a name="line.2151"></a>
<span class="sourceLineNo">2152</span>     * Sets the paint for the minor grid lines plotted against the range axis<a name="line.2152"></a>
<span class="sourceLineNo">2153</span>     * and sends a {@link PlotChangeEvent} to all registered listeners.<a name="line.2153"></a>
<span class="sourceLineNo">2154</span>     *<a name="line.2154"></a>
<span class="sourceLineNo">2155</span>     * @param paint  the paint (&lt;code&gt;null&lt;/code&gt; not permitted).<a name="line.2155"></a>
<span class="sourceLineNo">2156</span>     *<a name="line.2156"></a>
<span class="sourceLineNo">2157</span>     * @see #getRangeMinorGridlinePaint()<a name="line.2157"></a>
<span class="sourceLineNo">2158</span>     *<a name="line.2158"></a>
<span class="sourceLineNo">2159</span>     * @since 1.0.12<a name="line.2159"></a>
<span class="sourceLineNo">2160</span>     */<a name="line.2160"></a>
<span class="sourceLineNo">2161</span>    public void setRangeMinorGridlinePaint(Paint paint) {<a name="line.2161"></a>
<span class="sourceLineNo">2162</span>        if (paint == null) {<a name="line.2162"></a>
<span class="sourceLineNo">2163</span>            throw new IllegalArgumentException("Null 'paint' argument.");<a name="line.2163"></a>
<span class="sourceLineNo">2164</span>        }<a name="line.2164"></a>
<span class="sourceLineNo">2165</span>        this.rangeMinorGridlinePaint = paint;<a name="line.2165"></a>
<span class="sourceLineNo">2166</span>        fireChangeEvent();<a name="line.2166"></a>
<span class="sourceLineNo">2167</span>    }<a name="line.2167"></a>
<span class="sourceLineNo">2168</span><a name="line.2168"></a>
<span class="sourceLineNo">2169</span>    /**<a name="line.2169"></a>
<span class="sourceLineNo">2170</span>     * Returns a flag that controls whether or not a zero baseline is<a name="line.2170"></a>
<span class="sourceLineNo">2171</span>     * displayed for the domain axis.<a name="line.2171"></a>
<span class="sourceLineNo">2172</span>     *<a name="line.2172"></a>
<span class="sourceLineNo">2173</span>     * @return A boolean.<a name="line.2173"></a>
<span class="sourceLineNo">2174</span>     *<a name="line.2174"></a>
<span class="sourceLineNo">2175</span>     * @since 1.0.5<a name="line.2175"></a>
<span class="sourceLineNo">2176</span>     *<a name="line.2176"></a>
<span class="sourceLineNo">2177</span>     * @see #setDomainZeroBaselineVisible(boolean)<a name="line.2177"></a>
<span class="sourceLineNo">2178</span>     */<a name="line.2178"></a>
<span class="sourceLineNo">2179</span>    public boolean isDomainZeroBaselineVisible() {<a name="line.2179"></a>
<span class="sourceLineNo">2180</span>        return this.domainZeroBaselineVisible;<a name="line.2180"></a>
<span class="sourceLineNo">2181</span>    }<a name="line.2181"></a>
<span class="sourceLineNo">2182</span><a name="line.2182"></a>
<span class="sourceLineNo">2183</span>    /**<a name="line.2183"></a>
<span class="sourceLineNo">2184</span>     * Sets the flag that controls whether or not the zero baseline is<a name="line.2184"></a>
<span class="sourceLineNo">2185</span>     * displayed for the domain axis, and sends a {@link PlotChangeEvent} to<a name="line.2185"></a>
<span class="sourceLineNo">2186</span>     * all registered listeners.<a name="line.2186"></a>
<span class="sourceLineNo">2187</span>     *<a name="line.2187"></a>
<span class="sourceLineNo">2188</span>     * @param visible  the flag.<a name="line.2188"></a>
<span class="sourceLineNo">2189</span>     *<a name="line.2189"></a>
<span class="sourceLineNo">2190</span>     * @since 1.0.5<a name="line.2190"></a>
<span class="sourceLineNo">2191</span>     *<a name="line.2191"></a>
<span class="sourceLineNo">2192</span>     * @see #isDomainZeroBaselineVisible()<a name="line.2192"></a>
<span class="sourceLineNo">2193</span>     */<a name="line.2193"></a>
<span class="sourceLineNo">2194</span>    public void setDomainZeroBaselineVisible(boolean visible) {<a name="line.2194"></a>
<span class="sourceLineNo">2195</span>        this.domainZeroBaselineVisible = visible;<a name="line.2195"></a>
<span class="sourceLineNo">2196</span>        fireChangeEvent();<a name="line.2196"></a>
<span class="sourceLineNo">2197</span>    }<a name="line.2197"></a>
<span class="sourceLineNo">2198</span><a name="line.2198"></a>
<span class="sourceLineNo">2199</span>    /**<a name="line.2199"></a>
<span class="sourceLineNo">2200</span>     * Returns the stroke used for the zero baseline against the domain axis.<a name="line.2200"></a>
<span class="sourceLineNo">2201</span>     *<a name="line.2201"></a>
<span class="sourceLineNo">2202</span>     * @return The stroke (never &lt;code&gt;null&lt;/code&gt;).<a name="line.2202"></a>
<span class="sourceLineNo">2203</span>     *<a name="line.2203"></a>
<span class="sourceLineNo">2204</span>     * @since 1.0.5<a name="line.2204"></a>
<span class="sourceLineNo">2205</span>     *<a name="line.2205"></a>
<span class="sourceLineNo">2206</span>     * @see #setDomainZeroBaselineStroke(Stroke)<a name="line.2206"></a>
<span class="sourceLineNo">2207</span>     */<a name="line.2207"></a>
<span class="sourceLineNo">2208</span>    public Stroke getDomainZeroBaselineStroke() {<a name="line.2208"></a>
<span class="sourceLineNo">2209</span>        return this.domainZeroBaselineStroke;<a name="line.2209"></a>
<span class="sourceLineNo">2210</span>    }<a name="line.2210"></a>
<span class="sourceLineNo">2211</span><a name="line.2211"></a>
<span class="sourceLineNo">2212</span>    /**<a name="line.2212"></a>
<span class="sourceLineNo">2213</span>     * Sets the stroke for the zero baseline for the domain axis,<a name="line.2213"></a>
<span class="sourceLineNo">2214</span>     * and sends a {@link PlotChangeEvent} to all registered listeners.<a name="line.2214"></a>
<span class="sourceLineNo">2215</span>     *<a name="line.2215"></a>
<span class="sourceLineNo">2216</span>     * @param stroke  the stroke (&lt;code&gt;null&lt;/code&gt; not permitted).<a name="line.2216"></a>
<span class="sourceLineNo">2217</span>     *<a name="line.2217"></a>
<span class="sourceLineNo">2218</span>     * @since 1.0.5<a name="line.2218"></a>
<span class="sourceLineNo">2219</span>     *<a name="line.2219"></a>
<span class="sourceLineNo">2220</span>     * @see #getRangeZeroBaselineStroke()<a name="line.2220"></a>
<span class="sourceLineNo">2221</span>     */<a name="line.2221"></a>
<span class="sourceLineNo">2222</span>    public void setDomainZeroBaselineStroke(Stroke stroke) {<a name="line.2222"></a>
<span class="sourceLineNo">2223</span>        if (stroke == null) {<a name="line.2223"></a>
<span class="sourceLineNo">2224</span>            throw new IllegalArgumentException("Null 'stroke' argument.");<a name="line.2224"></a>
<span class="sourceLineNo">2225</span>        }<a name="line.2225"></a>
<span class="sourceLineNo">2226</span>        this.domainZeroBaselineStroke = stroke;<a name="line.2226"></a>
<span class="sourceLineNo">2227</span>        fireChangeEvent();<a name="line.2227"></a>
<span class="sourceLineNo">2228</span>    }<a name="line.2228"></a>
<span class="sourceLineNo">2229</span><a name="line.2229"></a>
<span class="sourceLineNo">2230</span>    /**<a name="line.2230"></a>
<span class="sourceLineNo">2231</span>     * Returns the paint for the zero baseline (if any) plotted against the<a name="line.2231"></a>
<span class="sourceLineNo">2232</span>     * domain axis.<a name="line.2232"></a>
<span class="sourceLineNo">2233</span>     *<a name="line.2233"></a>
<span class="sourceLineNo">2234</span>     * @since 1.0.5<a name="line.2234"></a>
<span class="sourceLineNo">2235</span>     *<a name="line.2235"></a>
<span class="sourceLineNo">2236</span>     * @return The paint (never &lt;code&gt;null&lt;/code&gt;).<a name="line.2236"></a>
<span class="sourceLineNo">2237</span>     *<a name="line.2237"></a>
<span class="sourceLineNo">2238</span>     * @see #setDomainZeroBaselinePaint(Paint)<a name="line.2238"></a>
<span class="sourceLineNo">2239</span>     */<a name="line.2239"></a>
<span class="sourceLineNo">2240</span>    public Paint getDomainZeroBaselinePaint() {<a name="line.2240"></a>
<span class="sourceLineNo">2241</span>        return this.domainZeroBaselinePaint;<a name="line.2241"></a>
<span class="sourceLineNo">2242</span>    }<a name="line.2242"></a>
<span class="sourceLineNo">2243</span><a name="line.2243"></a>
<span class="sourceLineNo">2244</span>    /**<a name="line.2244"></a>
<span class="sourceLineNo">2245</span>     * Sets the paint for the zero baseline plotted against the domain axis and<a name="line.2245"></a>
<span class="sourceLineNo">2246</span>     * sends a {@link PlotChangeEvent} to all registered listeners.<a name="line.2246"></a>
<span class="sourceLineNo">2247</span>     *<a name="line.2247"></a>
<span class="sourceLineNo">2248</span>     * @param paint  the paint (&lt;code&gt;null&lt;/code&gt; not permitted).<a name="line.2248"></a>
<span class="sourceLineNo">2249</span>     *<a name="line.2249"></a>
<span class="sourceLineNo">2250</span>     * @since 1.0.5<a name="line.2250"></a>
<span class="sourceLineNo">2251</span>     *<a name="line.2251"></a>
<span class="sourceLineNo">2252</span>     * @see #getDomainZeroBaselinePaint()<a name="line.2252"></a>
<span class="sourceLineNo">2253</span>     */<a name="line.2253"></a>
<span class="sourceLineNo">2254</span>    public void setDomainZeroBaselinePaint(Paint paint) {<a name="line.2254"></a>
<span class="sourceLineNo">2255</span>        if (paint == null) {<a name="line.2255"></a>
<span class="sourceLineNo">2256</span>            throw new IllegalArgumentException("Null 'paint' argument.");<a name="line.2256"></a>
<span class="sourceLineNo">2257</span>        }<a name="line.2257"></a>
<span class="sourceLineNo">2258</span>        this.domainZeroBaselinePaint = paint;<a name="line.2258"></a>
<span class="sourceLineNo">2259</span>        fireChangeEvent();<a name="line.2259"></a>
<span class="sourceLineNo">2260</span>    }<a name="line.2260"></a>
<span class="sourceLineNo">2261</span><a name="line.2261"></a>
<span class="sourceLineNo">2262</span>    /**<a name="line.2262"></a>
<span class="sourceLineNo">2263</span>     * Returns a flag that controls whether or not a zero baseline is<a name="line.2263"></a>
<span class="sourceLineNo">2264</span>     * displayed for the range axis.<a name="line.2264"></a>
<span class="sourceLineNo">2265</span>     *<a name="line.2265"></a>
<span class="sourceLineNo">2266</span>     * @return A boolean.<a name="line.2266"></a>
<span class="sourceLineNo">2267</span>     *<a name="line.2267"></a>
<span class="sourceLineNo">2268</span>     * @see #setRangeZeroBaselineVisible(boolean)<a name="line.2268"></a>
<span class="sourceLineNo">2269</span>     */<a name="line.2269"></a>
<span class="sourceLineNo">2270</span>    public boolean isRangeZeroBaselineVisible() {<a name="line.2270"></a>
<span class="sourceLineNo">2271</span>        return this.rangeZeroBaselineVisible;<a name="line.2271"></a>
<span class="sourceLineNo">2272</span>    }<a name="line.2272"></a>
<span class="sourceLineNo">2273</span><a name="line.2273"></a>
<span class="sourceLineNo">2274</span>    /**<a name="line.2274"></a>
<span class="sourceLineNo">2275</span>     * Sets the flag that controls whether or not the zero baseline is<a name="line.2275"></a>
<span class="sourceLineNo">2276</span>     * displayed for the range axis, and sends a {@link PlotChangeEvent} to<a name="line.2276"></a>
<span class="sourceLineNo">2277</span>     * all registered listeners.<a name="line.2277"></a>
<span class="sourceLineNo">2278</span>     *<a name="line.2278"></a>
<span class="sourceLineNo">2279</span>     * @param visible  the flag.<a name="line.2279"></a>
<span class="sourceLineNo">2280</span>     *<a name="line.2280"></a>
<span class="sourceLineNo">2281</span>     * @see #isRangeZeroBaselineVisible()<a name="line.2281"></a>
<span class="sourceLineNo">2282</span>     */<a name="line.2282"></a>
<span class="sourceLineNo">2283</span>    public void setRangeZeroBaselineVisible(boolean visible) {<a name="line.2283"></a>
<span class="sourceLineNo">2284</span>        this.rangeZeroBaselineVisible = visible;<a name="line.2284"></a>
<span class="sourceLineNo">2285</span>        fireChangeEvent();<a name="line.2285"></a>
<span class="sourceLineNo">2286</span>    }<a name="line.2286"></a>
<span class="sourceLineNo">2287</span><a name="line.2287"></a>
<span class="sourceLineNo">2288</span>    /**<a name="line.2288"></a>
<span class="sourceLineNo">2289</span>     * Returns the stroke used for the zero baseline against the range axis.<a name="line.2289"></a>
<span class="sourceLineNo">2290</span>     *<a name="line.2290"></a>
<span class="sourceLineNo">2291</span>     * @return The stroke (never &lt;code&gt;null&lt;/code&gt;).<a name="line.2291"></a>
<span class="sourceLineNo">2292</span>     *<a name="line.2292"></a>
<span class="sourceLineNo">2293</span>     * @see #setRangeZeroBaselineStroke(Stroke)<a name="line.2293"></a>
<span class="sourceLineNo">2294</span>     */<a name="line.2294"></a>
<span class="sourceLineNo">2295</span>    public Stroke getRangeZeroBaselineStroke() {<a name="line.2295"></a>
<span class="sourceLineNo">2296</span>        return this.rangeZeroBaselineStroke;<a name="line.2296"></a>
<span class="sourceLineNo">2297</span>    }<a name="line.2297"></a>
<span class="sourceLineNo">2298</span><a name="line.2298"></a>
<span class="sourceLineNo">2299</span>    /**<a name="line.2299"></a>
<span class="sourceLineNo">2300</span>     * Sets the stroke for the zero baseline for the range axis,<a name="line.2300"></a>
<span class="sourceLineNo">2301</span>     * and sends a {@link PlotChangeEvent} to all registered listeners.<a name="line.2301"></a>
<span class="sourceLineNo">2302</span>     *<a name="line.2302"></a>
<span class="sourceLineNo">2303</span>     * @param stroke  the stroke (&lt;code&gt;null&lt;/code&gt; not permitted).<a name="line.2303"></a>
<span class="sourceLineNo">2304</span>     *<a name="line.2304"></a>
<span class="sourceLineNo">2305</span>     * @see #getRangeZeroBaselineStroke()<a name="line.2305"></a>
<span class="sourceLineNo">2306</span>     */<a name="line.2306"></a>
<span class="sourceLineNo">2307</span>    public void setRangeZeroBaselineStroke(Stroke stroke) {<a name="line.2307"></a>
<span class="sourceLineNo">2308</span>        if (stroke == null) {<a name="line.2308"></a>
<span class="sourceLineNo">2309</span>            throw new IllegalArgumentException("Null 'stroke' argument.");<a name="line.2309"></a>
<span class="sourceLineNo">2310</span>        }<a name="line.2310"></a>
<span class="sourceLineNo">2311</span>        this.rangeZeroBaselineStroke = stroke;<a name="line.2311"></a>
<span class="sourceLineNo">2312</span>        fireChangeEvent();<a name="line.2312"></a>
<span class="sourceLineNo">2313</span>    }<a name="line.2313"></a>
<span class="sourceLineNo">2314</span><a name="line.2314"></a>
<span class="sourceLineNo">2315</span>    /**<a name="line.2315"></a>
<span class="sourceLineNo">2316</span>     * Returns the paint for the zero baseline (if any) plotted against the<a name="line.2316"></a>
<span class="sourceLineNo">2317</span>     * range axis.<a name="line.2317"></a>
<span class="sourceLineNo">2318</span>     *<a name="line.2318"></a>
<span class="sourceLineNo">2319</span>     * @return The paint (never &lt;code&gt;null&lt;/code&gt;).<a name="line.2319"></a>
<span class="sourceLineNo">2320</span>     *<a name="line.2320"></a>
<span class="sourceLineNo">2321</span>     * @see #setRangeZeroBaselinePaint(Paint)<a name="line.2321"></a>
<span class="sourceLineNo">2322</span>     */<a name="line.2322"></a>
<span class="sourceLineNo">2323</span>    public Paint getRangeZeroBaselinePaint() {<a name="line.2323"></a>
<span class="sourceLineNo">2324</span>        return this.rangeZeroBaselinePaint;<a name="line.2324"></a>
<span class="sourceLineNo">2325</span>    }<a name="line.2325"></a>
<span class="sourceLineNo">2326</span><a name="line.2326"></a>
<span class="sourceLineNo">2327</span>    /**<a name="line.2327"></a>
<span class="sourceLineNo">2328</span>     * Sets the paint for the zero baseline plotted against the range axis and<a name="line.2328"></a>
<span class="sourceLineNo">2329</span>     * sends a {@link PlotChangeEvent} to all registered listeners.<a name="line.2329"></a>
<span class="sourceLineNo">2330</span>     *<a name="line.2330"></a>
<span class="sourceLineNo">2331</span>     * @param paint  the paint (&lt;code&gt;null&lt;/code&gt; not permitted).<a name="line.2331"></a>
<span class="sourceLineNo">2332</span>     *<a name="line.2332"></a>
<span class="sourceLineNo">2333</span>     * @see #getRangeZeroBaselinePaint()<a name="line.2333"></a>
<span class="sourceLineNo">2334</span>     */<a name="line.2334"></a>
<span class="sourceLineNo">2335</span>    public void setRangeZeroBaselinePaint(Paint paint) {<a name="line.2335"></a>
<span class="sourceLineNo">2336</span>        if (paint == null) {<a name="line.2336"></a>
<span class="sourceLineNo">2337</span>            throw new IllegalArgumentException("Null 'paint' argument.");<a name="line.2337"></a>
<span class="sourceLineNo">2338</span>        }<a name="line.2338"></a>
<span class="sourceLineNo">2339</span>        this.rangeZeroBaselinePaint = paint;<a name="line.2339"></a>
<span class="sourceLineNo">2340</span>        fireChangeEvent();<a name="line.2340"></a>
<span class="sourceLineNo">2341</span>    }<a name="line.2341"></a>
<span class="sourceLineNo">2342</span><a name="line.2342"></a>
<span class="sourceLineNo">2343</span>    /**<a name="line.2343"></a>
<span class="sourceLineNo">2344</span>     * Returns the paint used for the domain tick bands.  If this is<a name="line.2344"></a>
<span class="sourceLineNo">2345</span>     * &lt;code&gt;null&lt;/code&gt;, no tick bands will be drawn.<a name="line.2345"></a>
<span class="sourceLineNo">2346</span>     *<a name="line.2346"></a>
<span class="sourceLineNo">2347</span>     * @return The paint (possibly &lt;code&gt;null&lt;/code&gt;).<a name="line.2347"></a>
<span class="sourceLineNo">2348</span>     *<a name="line.2348"></a>
<span class="sourceLineNo">2349</span>     * @see #setDomainTickBandPaint(Paint)<a name="line.2349"></a>
<span class="sourceLineNo">2350</span>     */<a name="line.2350"></a>
<span class="sourceLineNo">2351</span>    public Paint getDomainTickBandPaint() {<a name="line.2351"></a>
<span class="sourceLineNo">2352</span>        return this.domainTickBandPaint;<a name="line.2352"></a>
<span class="sourceLineNo">2353</span>    }<a name="line.2353"></a>
<span class="sourceLineNo">2354</span><a name="line.2354"></a>
<span class="sourceLineNo">2355</span>    /**<a name="line.2355"></a>
<span class="sourceLineNo">2356</span>     * Sets the paint for the domain tick bands.<a name="line.2356"></a>
<span class="sourceLineNo">2357</span>     *<a name="line.2357"></a>
<span class="sourceLineNo">2358</span>     * @param paint  the paint (&lt;code&gt;null&lt;/code&gt; permitted).<a name="line.2358"></a>
<span class="sourceLineNo">2359</span>     *<a name="line.2359"></a>
<span class="sourceLineNo">2360</span>     * @see #getDomainTickBandPaint()<a name="line.2360"></a>
<span class="sourceLineNo">2361</span>     */<a name="line.2361"></a>
<span class="sourceLineNo">2362</span>    public void setDomainTickBandPaint(Paint paint) {<a name="line.2362"></a>
<span class="sourceLineNo">2363</span>        this.domainTickBandPaint = paint;<a name="line.2363"></a>
<span class="sourceLineNo">2364</span>        fireChangeEvent();<a name="line.2364"></a>
<span class="sourceLineNo">2365</span>    }<a name="line.2365"></a>
<span class="sourceLineNo">2366</span><a name="line.2366"></a>
<span class="sourceLineNo">2367</span>    /**<a name="line.2367"></a>
<span class="sourceLineNo">2368</span>     * Returns the paint used for the range tick bands.  If this is<a name="line.2368"></a>
<span class="sourceLineNo">2369</span>     * &lt;code&gt;null&lt;/code&gt;, no tick bands will be drawn.<a name="line.2369"></a>
<span class="sourceLineNo">2370</span>     *<a name="line.2370"></a>
<span class="sourceLineNo">2371</span>     * @return The paint (possibly &lt;code&gt;null&lt;/code&gt;).<a name="line.2371"></a>
<span class="sourceLineNo">2372</span>     *<a name="line.2372"></a>
<span class="sourceLineNo">2373</span>     * @see #setRangeTickBandPaint(Paint)<a name="line.2373"></a>
<span class="sourceLineNo">2374</span>     */<a name="line.2374"></a>
<span class="sourceLineNo">2375</span>    public Paint getRangeTickBandPaint() {<a name="line.2375"></a>
<span class="sourceLineNo">2376</span>        return this.rangeTickBandPaint;<a name="line.2376"></a>
<span class="sourceLineNo">2377</span>    }<a name="line.2377"></a>
<span class="sourceLineNo">2378</span><a name="line.2378"></a>
<span class="sourceLineNo">2379</span>    /**<a name="line.2379"></a>
<span class="sourceLineNo">2380</span>     * Sets the paint for the range tick bands.<a name="line.2380"></a>
<span class="sourceLineNo">2381</span>     *<a name="line.2381"></a>
<span class="sourceLineNo">2382</span>     * @param paint  the paint (&lt;code&gt;null&lt;/code&gt; permitted).<a name="line.2382"></a>
<span class="sourceLineNo">2383</span>     *<a name="line.2383"></a>
<span class="sourceLineNo">2384</span>     * @see #getRangeTickBandPaint()<a name="line.2384"></a>
<span class="sourceLineNo">2385</span>     */<a name="line.2385"></a>
<span class="sourceLineNo">2386</span>    public void setRangeTickBandPaint(Paint paint) {<a name="line.2386"></a>
<span class="sourceLineNo">2387</span>        this.rangeTickBandPaint = paint;<a name="line.2387"></a>
<span class="sourceLineNo">2388</span>        fireChangeEvent();<a name="line.2388"></a>
<span class="sourceLineNo">2389</span>    }<a name="line.2389"></a>
<span class="sourceLineNo">2390</span><a name="line.2390"></a>
<span class="sourceLineNo">2391</span>    /**<a name="line.2391"></a>
<span class="sourceLineNo">2392</span>     * Returns the origin for the quadrants that can be displayed on the plot.<a name="line.2392"></a>
<span class="sourceLineNo">2393</span>     * This defaults to (0, 0).<a name="line.2393"></a>
<span class="sourceLineNo">2394</span>     *<a name="line.2394"></a>
<span class="sourceLineNo">2395</span>     * @return The origin point (never &lt;code&gt;null&lt;/code&gt;).<a name="line.2395"></a>
<span class="sourceLineNo">2396</span>     *<a name="line.2396"></a>
<span class="sourceLineNo">2397</span>     * @see #setQuadrantOrigin(Point2D)<a name="line.2397"></a>
<span class="sourceLineNo">2398</span>     */<a name="line.2398"></a>
<span class="sourceLineNo">2399</span>    public Point2D getQuadrantOrigin() {<a name="line.2399"></a>
<span class="sourceLineNo">2400</span>        return this.quadrantOrigin;<a name="line.2400"></a>
<span class="sourceLineNo">2401</span>    }<a name="line.2401"></a>
<span class="sourceLineNo">2402</span><a name="line.2402"></a>
<span class="sourceLineNo">2403</span>    /**<a name="line.2403"></a>
<span class="sourceLineNo">2404</span>     * Sets the quadrant origin and sends a {@link PlotChangeEvent} to all<a name="line.2404"></a>
<span class="sourceLineNo">2405</span>     * registered listeners.<a name="line.2405"></a>
<span class="sourceLineNo">2406</span>     *<a name="line.2406"></a>
<span class="sourceLineNo">2407</span>     * @param origin  the origin (&lt;code&gt;null&lt;/code&gt; not permitted).<a name="line.2407"></a>
<span class="sourceLineNo">2408</span>     *<a name="line.2408"></a>
<span class="sourceLineNo">2409</span>     * @see #getQuadrantOrigin()<a name="line.2409"></a>
<span class="sourceLineNo">2410</span>     */<a name="line.2410"></a>
<span class="sourceLineNo">2411</span>    public void setQuadrantOrigin(Point2D origin) {<a name="line.2411"></a>
<span class="sourceLineNo">2412</span>        if (origin == null) {<a name="line.2412"></a>
<span class="sourceLineNo">2413</span>            throw new IllegalArgumentException("Null 'origin' argument.");<a name="line.2413"></a>
<span class="sourceLineNo">2414</span>        }<a name="line.2414"></a>
<span class="sourceLineNo">2415</span>        this.quadrantOrigin = origin;<a name="line.2415"></a>
<span class="sourceLineNo">2416</span>        fireChangeEvent();<a name="line.2416"></a>
<span class="sourceLineNo">2417</span>    }<a name="line.2417"></a>
<span class="sourceLineNo">2418</span><a name="line.2418"></a>
<span class="sourceLineNo">2419</span>    /**<a name="line.2419"></a>
<span class="sourceLineNo">2420</span>     * Returns the paint used for the specified quadrant.<a name="line.2420"></a>
<span class="sourceLineNo">2421</span>     *<a name="line.2421"></a>
<span class="sourceLineNo">2422</span>     * @param index  the quadrant index (0-3).<a name="line.2422"></a>
<span class="sourceLineNo">2423</span>     *<a name="line.2423"></a>
<span class="sourceLineNo">2424</span>     * @return The paint (possibly &lt;code&gt;null&lt;/code&gt;).<a name="line.2424"></a>
<span class="sourceLineNo">2425</span>     *<a name="line.2425"></a>
<span class="sourceLineNo">2426</span>     * @see #setQuadrantPaint(int, Paint)<a name="line.2426"></a>
<span class="sourceLineNo">2427</span>     */<a name="line.2427"></a>
<span class="sourceLineNo">2428</span>    public Paint getQuadrantPaint(int index) {<a name="line.2428"></a>
<span class="sourceLineNo">2429</span>        if (index &lt; 0 || index &gt; 3) {<a name="line.2429"></a>
<span class="sourceLineNo">2430</span>            throw new IllegalArgumentException("The index value (" + index<a name="line.2430"></a>
<span class="sourceLineNo">2431</span>                    + ") should be in the range 0 to 3.");<a name="line.2431"></a>
<span class="sourceLineNo">2432</span>        }<a name="line.2432"></a>
<span class="sourceLineNo">2433</span>        return this.quadrantPaint[index];<a name="line.2433"></a>
<span class="sourceLineNo">2434</span>    }<a name="line.2434"></a>
<span class="sourceLineNo">2435</span><a name="line.2435"></a>
<span class="sourceLineNo">2436</span>    /**<a name="line.2436"></a>
<span class="sourceLineNo">2437</span>     * Sets the paint used for the specified quadrant and sends a<a name="line.2437"></a>
<span class="sourceLineNo">2438</span>     * {@link PlotChangeEvent} to all registered listeners.<a name="line.2438"></a>
<span class="sourceLineNo">2439</span>     *<a name="line.2439"></a>
<span class="sourceLineNo">2440</span>     * @param index  the quadrant index (0-3).<a name="line.2440"></a>
<span class="sourceLineNo">2441</span>     * @param paint  the paint (&lt;code&gt;null&lt;/code&gt; permitted).<a name="line.2441"></a>
<span class="sourceLineNo">2442</span>     *<a name="line.2442"></a>
<span class="sourceLineNo">2443</span>     * @see #getQuadrantPaint(int)<a name="line.2443"></a>
<span class="sourceLineNo">2444</span>     */<a name="line.2444"></a>
<span class="sourceLineNo">2445</span>    public void setQuadrantPaint(int index, Paint paint) {<a name="line.2445"></a>
<span class="sourceLineNo">2446</span>        if (index &lt; 0 || index &gt; 3) {<a name="line.2446"></a>
<span class="sourceLineNo">2447</span>            throw new IllegalArgumentException("The index value (" + index<a name="line.2447"></a>
<span class="sourceLineNo">2448</span>                    + ") should be in the range 0 to 3.");<a name="line.2448"></a>
<span class="sourceLineNo">2449</span>        }<a name="line.2449"></a>
<span class="sourceLineNo">2450</span>        this.quadrantPaint[index] = paint;<a name="line.2450"></a>
<span class="sourceLineNo">2451</span>        fireChangeEvent();<a name="line.2451"></a>
<span class="sourceLineNo">2452</span>    }<a name="line.2452"></a>
<span class="sourceLineNo">2453</span><a name="line.2453"></a>
<span class="sourceLineNo">2454</span>    /**<a name="line.2454"></a>
<span class="sourceLineNo">2455</span>     * Adds a marker for the domain axis and sends a {@link PlotChangeEvent}<a name="line.2455"></a>
<span class="sourceLineNo">2456</span>     * to all registered listeners.<a name="line.2456"></a>
<span class="sourceLineNo">2457</span>     * &lt;P&gt;<a name="line.2457"></a>
<span class="sourceLineNo">2458</span>     * Typically a marker will be drawn by the renderer as a line perpendicular<a name="line.2458"></a>
<span class="sourceLineNo">2459</span>     * to the range axis, however this is entirely up to the renderer.<a name="line.2459"></a>
<span class="sourceLineNo">2460</span>     *<a name="line.2460"></a>
<span class="sourceLineNo">2461</span>     * @param marker  the marker (&lt;code&gt;null&lt;/code&gt; not permitted).<a name="line.2461"></a>
<span class="sourceLineNo">2462</span>     *<a name="line.2462"></a>
<span class="sourceLineNo">2463</span>     * @see #addDomainMarker(Marker, Layer)<a name="line.2463"></a>
<span class="sourceLineNo">2464</span>     * @see #clearDomainMarkers()<a name="line.2464"></a>
<span class="sourceLineNo">2465</span>     */<a name="line.2465"></a>
<span class="sourceLineNo">2466</span>    public void addDomainMarker(Marker marker) {<a name="line.2466"></a>
<span class="sourceLineNo">2467</span>        // defer argument checking...<a name="line.2467"></a>
<span class="sourceLineNo">2468</span>        addDomainMarker(marker, Layer.FOREGROUND);<a name="line.2468"></a>
<span class="sourceLineNo">2469</span>    }<a name="line.2469"></a>
<span class="sourceLineNo">2470</span><a name="line.2470"></a>
<span class="sourceLineNo">2471</span>    /**<a name="line.2471"></a>
<span class="sourceLineNo">2472</span>     * Adds a marker for the domain axis in the specified layer and sends a<a name="line.2472"></a>
<span class="sourceLineNo">2473</span>     * {@link PlotChangeEvent} to all registered listeners.<a name="line.2473"></a>
<span class="sourceLineNo">2474</span>     * &lt;P&gt;<a name="line.2474"></a>
<span class="sourceLineNo">2475</span>     * Typically a marker will be drawn by the renderer as a line perpendicular<a name="line.2475"></a>
<span class="sourceLineNo">2476</span>     * to the range axis, however this is entirely up to the renderer.<a name="line.2476"></a>
<span class="sourceLineNo">2477</span>     *<a name="line.2477"></a>
<span class="sourceLineNo">2478</span>     * @param marker  the marker (&lt;code&gt;null&lt;/code&gt; not permitted).<a name="line.2478"></a>
<span class="sourceLineNo">2479</span>     * @param layer  the layer (foreground or background).<a name="line.2479"></a>
<span class="sourceLineNo">2480</span>     *<a name="line.2480"></a>
<span class="sourceLineNo">2481</span>     * @see #addDomainMarker(int, Marker, Layer)<a name="line.2481"></a>
<span class="sourceLineNo">2482</span>     */<a name="line.2482"></a>
<span class="sourceLineNo">2483</span>    public void addDomainMarker(Marker marker, Layer layer) {<a name="line.2483"></a>
<span class="sourceLineNo">2484</span>        addDomainMarker(0, marker, layer);<a name="line.2484"></a>
<span class="sourceLineNo">2485</span>    }<a name="line.2485"></a>
<span class="sourceLineNo">2486</span><a name="line.2486"></a>
<span class="sourceLineNo">2487</span>    /**<a name="line.2487"></a>
<span class="sourceLineNo">2488</span>     * Clears all the (foreground and background) domain markers and sends a<a name="line.2488"></a>
<span class="sourceLineNo">2489</span>     * {@link PlotChangeEvent} to all registered listeners.<a name="line.2489"></a>
<span class="sourceLineNo">2490</span>     *<a name="line.2490"></a>
<span class="sourceLineNo">2491</span>     * @see #addDomainMarker(int, Marker, Layer)<a name="line.2491"></a>
<span class="sourceLineNo">2492</span>     */<a name="line.2492"></a>
<span class="sourceLineNo">2493</span>    public void clearDomainMarkers() {<a name="line.2493"></a>
<span class="sourceLineNo">2494</span>        if (this.backgroundDomainMarkers != null) {<a name="line.2494"></a>
<span class="sourceLineNo">2495</span>            Set keys = this.backgroundDomainMarkers.keySet();<a name="line.2495"></a>
<span class="sourceLineNo">2496</span>            Iterator iterator = keys.iterator();<a name="line.2496"></a>
<span class="sourceLineNo">2497</span>            while (iterator.hasNext()) {<a name="line.2497"></a>
<span class="sourceLineNo">2498</span>                Integer key = (Integer) iterator.next();<a name="line.2498"></a>
<span class="sourceLineNo">2499</span>                clearDomainMarkers(key.intValue());<a name="line.2499"></a>
<span class="sourceLineNo">2500</span>            }<a name="line.2500"></a>
<span class="sourceLineNo">2501</span>            this.backgroundDomainMarkers.clear();<a name="line.2501"></a>
<span class="sourceLineNo">2502</span>        }<a name="line.2502"></a>
<span class="sourceLineNo">2503</span>        if (this.foregroundDomainMarkers != null) {<a name="line.2503"></a>
<span class="sourceLineNo">2504</span>            Set keys = this.foregroundDomainMarkers.keySet();<a name="line.2504"></a>
<span class="sourceLineNo">2505</span>            Iterator iterator = keys.iterator();<a name="line.2505"></a>
<span class="sourceLineNo">2506</span>            while (iterator.hasNext()) {<a name="line.2506"></a>
<span class="sourceLineNo">2507</span>                Integer key = (Integer) iterator.next();<a name="line.2507"></a>
<span class="sourceLineNo">2508</span>                clearDomainMarkers(key.intValue());<a name="line.2508"></a>
<span class="sourceLineNo">2509</span>            }<a name="line.2509"></a>
<span class="sourceLineNo">2510</span>            this.foregroundDomainMarkers.clear();<a name="line.2510"></a>
<span class="sourceLineNo">2511</span>        }<a name="line.2511"></a>
<span class="sourceLineNo">2512</span>        fireChangeEvent();<a name="line.2512"></a>
<span class="sourceLineNo">2513</span>    }<a name="line.2513"></a>
<span class="sourceLineNo">2514</span><a name="line.2514"></a>
<span class="sourceLineNo">2515</span>    /**<a name="line.2515"></a>
<span class="sourceLineNo">2516</span>     * Clears the (foreground and background) domain markers for a particular<a name="line.2516"></a>
<span class="sourceLineNo">2517</span>     * renderer.<a name="line.2517"></a>
<span class="sourceLineNo">2518</span>     *<a name="line.2518"></a>
<span class="sourceLineNo">2519</span>     * @param index  the renderer index.<a name="line.2519"></a>
<span class="sourceLineNo">2520</span>     *<a name="line.2520"></a>
<span class="sourceLineNo">2521</span>     * @see #clearRangeMarkers(int)<a name="line.2521"></a>
<span class="sourceLineNo">2522</span>     */<a name="line.2522"></a>
<span class="sourceLineNo">2523</span>    public void clearDomainMarkers(int index) {<a name="line.2523"></a>
<span class="sourceLineNo">2524</span>        Integer key = new Integer(index);<a name="line.2524"></a>
<span class="sourceLineNo">2525</span>        if (this.backgroundDomainMarkers != null) {<a name="line.2525"></a>
<span class="sourceLineNo">2526</span>            Collection markers<a name="line.2526"></a>
<span class="sourceLineNo">2527</span>                = (Collection) this.backgroundDomainMarkers.get(key);<a name="line.2527"></a>
<span class="sourceLineNo">2528</span>            if (markers != null) {<a name="line.2528"></a>
<span class="sourceLineNo">2529</span>                Iterator iterator = markers.iterator();<a name="line.2529"></a>
<span class="sourceLineNo">2530</span>                while (iterator.hasNext()) {<a name="line.2530"></a>
<span class="sourceLineNo">2531</span>                    Marker m = (Marker) iterator.next();<a name="line.2531"></a>
<span class="sourceLineNo">2532</span>                    m.removeChangeListener(this);<a name="line.2532"></a>
<span class="sourceLineNo">2533</span>                }<a name="line.2533"></a>
<span class="sourceLineNo">2534</span>                markers.clear();<a name="line.2534"></a>
<span class="sourceLineNo">2535</span>            }<a name="line.2535"></a>
<span class="sourceLineNo">2536</span>        }<a name="line.2536"></a>
<span class="sourceLineNo">2537</span>        if (this.foregroundRangeMarkers != null) {<a name="line.2537"></a>
<span class="sourceLineNo">2538</span>            Collection markers<a name="line.2538"></a>
<span class="sourceLineNo">2539</span>                = (Collection) this.foregroundDomainMarkers.get(key);<a name="line.2539"></a>
<span class="sourceLineNo">2540</span>            if (markers != null) {<a name="line.2540"></a>
<span class="sourceLineNo">2541</span>                Iterator iterator = markers.iterator();<a name="line.2541"></a>
<span class="sourceLineNo">2542</span>                while (iterator.hasNext()) {<a name="line.2542"></a>
<span class="sourceLineNo">2543</span>                    Marker m = (Marker) iterator.next();<a name="line.2543"></a>
<span class="sourceLineNo">2544</span>                    m.removeChangeListener(this);<a name="line.2544"></a>
<span class="sourceLineNo">2545</span>                }<a name="line.2545"></a>
<span class="sourceLineNo">2546</span>                markers.clear();<a name="line.2546"></a>
<span class="sourceLineNo">2547</span>            }<a name="line.2547"></a>
<span class="sourceLineNo">2548</span>        }<a name="line.2548"></a>
<span class="sourceLineNo">2549</span>        fireChangeEvent();<a name="line.2549"></a>
<span class="sourceLineNo">2550</span>    }<a name="line.2550"></a>
<span class="sourceLineNo">2551</span><a name="line.2551"></a>
<span class="sourceLineNo">2552</span>    /**<a name="line.2552"></a>
<span class="sourceLineNo">2553</span>     * Adds a marker for a specific dataset/renderer and sends a<a name="line.2553"></a>
<span class="sourceLineNo">2554</span>     * {@link PlotChangeEvent} to all registered listeners.<a name="line.2554"></a>
<span class="sourceLineNo">2555</span>     * &lt;P&gt;<a name="line.2555"></a>
<span class="sourceLineNo">2556</span>     * Typically a marker will be drawn by the renderer as a line perpendicular<a name="line.2556"></a>
<span class="sourceLineNo">2557</span>     * to the domain axis (that the renderer is mapped to), however this is<a name="line.2557"></a>
<span class="sourceLineNo">2558</span>     * entirely up to the renderer.<a name="line.2558"></a>
<span class="sourceLineNo">2559</span>     *<a name="line.2559"></a>
<span class="sourceLineNo">2560</span>     * @param index  the dataset/renderer index.<a name="line.2560"></a>
<span class="sourceLineNo">2561</span>     * @param marker  the marker.<a name="line.2561"></a>
<span class="sourceLineNo">2562</span>     * @param layer  the layer (foreground or background).<a name="line.2562"></a>
<span class="sourceLineNo">2563</span>     *<a name="line.2563"></a>
<span class="sourceLineNo">2564</span>     * @see #clearDomainMarkers(int)<a name="line.2564"></a>
<span class="sourceLineNo">2565</span>     * @see #addRangeMarker(int, Marker, Layer)<a name="line.2565"></a>
<span class="sourceLineNo">2566</span>     */<a name="line.2566"></a>
<span class="sourceLineNo">2567</span>    public void addDomainMarker(int index, Marker marker, Layer layer) {<a name="line.2567"></a>
<span class="sourceLineNo">2568</span>        addDomainMarker(index, marker, layer, true);<a name="line.2568"></a>
<span class="sourceLineNo">2569</span>    }<a name="line.2569"></a>
<span class="sourceLineNo">2570</span><a name="line.2570"></a>
<span class="sourceLineNo">2571</span>    /**<a name="line.2571"></a>
<span class="sourceLineNo">2572</span>     * Adds a marker for a specific dataset/renderer and, if requested, sends a<a name="line.2572"></a>
<span class="sourceLineNo">2573</span>     * {@link PlotChangeEvent} to all registered listeners.<a name="line.2573"></a>
<span class="sourceLineNo">2574</span>     * &lt;P&gt;<a name="line.2574"></a>
<span class="sourceLineNo">2575</span>     * Typically a marker will be drawn by the renderer as a line perpendicular<a name="line.2575"></a>
<span class="sourceLineNo">2576</span>     * to the domain axis (that the renderer is mapped to), however this is<a name="line.2576"></a>
<span class="sourceLineNo">2577</span>     * entirely up to the renderer.<a name="line.2577"></a>
<span class="sourceLineNo">2578</span>     *<a name="line.2578"></a>
<span class="sourceLineNo">2579</span>     * @param index  the dataset/renderer index.<a name="line.2579"></a>
<span class="sourceLineNo">2580</span>     * @param marker  the marker.<a name="line.2580"></a>
<span class="sourceLineNo">2581</span>     * @param layer  the layer (foreground or background).<a name="line.2581"></a>
<span class="sourceLineNo">2582</span>     * @param notify  notify listeners?<a name="line.2582"></a>
<span class="sourceLineNo">2583</span>     *<a name="line.2583"></a>
<span class="sourceLineNo">2584</span>     * @since 1.0.10<a name="line.2584"></a>
<span class="sourceLineNo">2585</span>     */<a name="line.2585"></a>
<span class="sourceLineNo">2586</span>    public void addDomainMarker(int index, Marker marker, Layer layer,<a name="line.2586"></a>
<span class="sourceLineNo">2587</span>            boolean notify) {<a name="line.2587"></a>
<span class="sourceLineNo">2588</span>        if (marker == null) {<a name="line.2588"></a>
<span class="sourceLineNo">2589</span>            throw new IllegalArgumentException("Null 'marker' not permitted.");<a name="line.2589"></a>
<span class="sourceLineNo">2590</span>        }<a name="line.2590"></a>
<span class="sourceLineNo">2591</span>        if (layer == null) {<a name="line.2591"></a>
<span class="sourceLineNo">2592</span>            throw new IllegalArgumentException("Null 'layer' not permitted.");<a name="line.2592"></a>
<span class="sourceLineNo">2593</span>        }<a name="line.2593"></a>
<span class="sourceLineNo">2594</span>        Collection markers;<a name="line.2594"></a>
<span class="sourceLineNo">2595</span>        if (layer == Layer.FOREGROUND) {<a name="line.2595"></a>
<span class="sourceLineNo">2596</span>            markers = (Collection) this.foregroundDomainMarkers.get(<a name="line.2596"></a>
<span class="sourceLineNo">2597</span>                    new Integer(index));<a name="line.2597"></a>
<span class="sourceLineNo">2598</span>            if (markers == null) {<a name="line.2598"></a>
<span class="sourceLineNo">2599</span>                markers = new java.util.ArrayList();<a name="line.2599"></a>
<span class="sourceLineNo">2600</span>                this.foregroundDomainMarkers.put(new Integer(index), markers);<a name="line.2600"></a>
<span class="sourceLineNo">2601</span>            }<a name="line.2601"></a>
<span class="sourceLineNo">2602</span>            markers.add(marker);<a name="line.2602"></a>
<span class="sourceLineNo">2603</span>        }<a name="line.2603"></a>
<span class="sourceLineNo">2604</span>        else if (layer == Layer.BACKGROUND) {<a name="line.2604"></a>
<span class="sourceLineNo">2605</span>            markers = (Collection) this.backgroundDomainMarkers.get(<a name="line.2605"></a>
<span class="sourceLineNo">2606</span>                    new Integer(index));<a name="line.2606"></a>
<span class="sourceLineNo">2607</span>            if (markers == null) {<a name="line.2607"></a>
<span class="sourceLineNo">2608</span>                markers = new java.util.ArrayList();<a name="line.2608"></a>
<span class="sourceLineNo">2609</span>                this.backgroundDomainMarkers.put(new Integer(index), markers);<a name="line.2609"></a>
<span class="sourceLineNo">2610</span>            }<a name="line.2610"></a>
<span class="sourceLineNo">2611</span>            markers.add(marker);<a name="line.2611"></a>
<span class="sourceLineNo">2612</span>        }<a name="line.2612"></a>
<span class="sourceLineNo">2613</span>        marker.addChangeListener(this);<a name="line.2613"></a>
<span class="sourceLineNo">2614</span>        if (notify) {<a name="line.2614"></a>
<span class="sourceLineNo">2615</span>            fireChangeEvent();<a name="line.2615"></a>
<span class="sourceLineNo">2616</span>        }<a name="line.2616"></a>
<span class="sourceLineNo">2617</span>    }<a name="line.2617"></a>
<span class="sourceLineNo">2618</span><a name="line.2618"></a>
<span class="sourceLineNo">2619</span>    /**<a name="line.2619"></a>
<span class="sourceLineNo">2620</span>     * Removes a marker for the domain axis and sends a {@link PlotChangeEvent}<a name="line.2620"></a>
<span class="sourceLineNo">2621</span>     * to all registered listeners.<a name="line.2621"></a>
<span class="sourceLineNo">2622</span>     *<a name="line.2622"></a>
<span class="sourceLineNo">2623</span>     * @param marker  the marker.<a name="line.2623"></a>
<span class="sourceLineNo">2624</span>     *<a name="line.2624"></a>
<span class="sourceLineNo">2625</span>     * @return A boolean indicating whether or not the marker was actually<a name="line.2625"></a>
<span class="sourceLineNo">2626</span>     *         removed.<a name="line.2626"></a>
<span class="sourceLineNo">2627</span>     *<a name="line.2627"></a>
<span class="sourceLineNo">2628</span>     * @since 1.0.7<a name="line.2628"></a>
<span class="sourceLineNo">2629</span>     */<a name="line.2629"></a>
<span class="sourceLineNo">2630</span>    public boolean removeDomainMarker(Marker marker) {<a name="line.2630"></a>
<span class="sourceLineNo">2631</span>        return removeDomainMarker(marker, Layer.FOREGROUND);<a name="line.2631"></a>
<span class="sourceLineNo">2632</span>    }<a name="line.2632"></a>
<span class="sourceLineNo">2633</span><a name="line.2633"></a>
<span class="sourceLineNo">2634</span>    /**<a name="line.2634"></a>
<span class="sourceLineNo">2635</span>     * Removes a marker for the domain axis in the specified layer and sends a<a name="line.2635"></a>
<span class="sourceLineNo">2636</span>     * {@link PlotChangeEvent} to all registered listeners.<a name="line.2636"></a>
<span class="sourceLineNo">2637</span>     *<a name="line.2637"></a>
<span class="sourceLineNo">2638</span>     * @param marker the marker (&lt;code&gt;null&lt;/code&gt; not permitted).<a name="line.2638"></a>
<span class="sourceLineNo">2639</span>     * @param layer the layer (foreground or background).<a name="line.2639"></a>
<span class="sourceLineNo">2640</span>     *<a name="line.2640"></a>
<span class="sourceLineNo">2641</span>     * @return A boolean indicating whether or not the marker was actually<a name="line.2641"></a>
<span class="sourceLineNo">2642</span>     *         removed.<a name="line.2642"></a>
<span class="sourceLineNo">2643</span>     *<a name="line.2643"></a>
<span class="sourceLineNo">2644</span>     * @since 1.0.7<a name="line.2644"></a>
<span class="sourceLineNo">2645</span>     */<a name="line.2645"></a>
<span class="sourceLineNo">2646</span>    public boolean removeDomainMarker(Marker marker, Layer layer) {<a name="line.2646"></a>
<span class="sourceLineNo">2647</span>        return removeDomainMarker(0, marker, layer);<a name="line.2647"></a>
<span class="sourceLineNo">2648</span>    }<a name="line.2648"></a>
<span class="sourceLineNo">2649</span><a name="line.2649"></a>
<span class="sourceLineNo">2650</span>    /**<a name="line.2650"></a>
<span class="sourceLineNo">2651</span>     * Removes a marker for a specific dataset/renderer and sends a<a name="line.2651"></a>
<span class="sourceLineNo">2652</span>     * {@link PlotChangeEvent} to all registered listeners.<a name="line.2652"></a>
<span class="sourceLineNo">2653</span>     *<a name="line.2653"></a>
<span class="sourceLineNo">2654</span>     * @param index the dataset/renderer index.<a name="line.2654"></a>
<span class="sourceLineNo">2655</span>     * @param marker the marker.<a name="line.2655"></a>
<span class="sourceLineNo">2656</span>     * @param layer the layer (foreground or background).<a name="line.2656"></a>
<span class="sourceLineNo">2657</span>     *<a name="line.2657"></a>
<span class="sourceLineNo">2658</span>     * @return A boolean indicating whether or not the marker was actually<a name="line.2658"></a>
<span class="sourceLineNo">2659</span>     *         removed.<a name="line.2659"></a>
<span class="sourceLineNo">2660</span>     *<a name="line.2660"></a>
<span class="sourceLineNo">2661</span>     * @since 1.0.7<a name="line.2661"></a>
<span class="sourceLineNo">2662</span>     */<a name="line.2662"></a>
<span class="sourceLineNo">2663</span>    public boolean removeDomainMarker(int index, Marker marker, Layer layer) {<a name="line.2663"></a>
<span class="sourceLineNo">2664</span>        return removeDomainMarker(index, marker, layer, true);<a name="line.2664"></a>
<span class="sourceLineNo">2665</span>    }<a name="line.2665"></a>
<span class="sourceLineNo">2666</span><a name="line.2666"></a>
<span class="sourceLineNo">2667</span>    /**<a name="line.2667"></a>
<span class="sourceLineNo">2668</span>     * Removes a marker for a specific dataset/renderer and, if requested,<a name="line.2668"></a>
<span class="sourceLineNo">2669</span>     * sends a {@link PlotChangeEvent} to all registered listeners.<a name="line.2669"></a>
<span class="sourceLineNo">2670</span>     *<a name="line.2670"></a>
<span class="sourceLineNo">2671</span>     * @param index  the dataset/renderer index.<a name="line.2671"></a>
<span class="sourceLineNo">2672</span>     * @param marker  the marker.<a name="line.2672"></a>
<span class="sourceLineNo">2673</span>     * @param layer  the layer (foreground or background).<a name="line.2673"></a>
<span class="sourceLineNo">2674</span>     * @param notify  notify listeners?<a name="line.2674"></a>
<span class="sourceLineNo">2675</span>     *<a name="line.2675"></a>
<span class="sourceLineNo">2676</span>     * @return A boolean indicating whether or not the marker was actually<a name="line.2676"></a>
<span class="sourceLineNo">2677</span>     *         removed.<a name="line.2677"></a>
<span class="sourceLineNo">2678</span>     *<a name="line.2678"></a>
<span class="sourceLineNo">2679</span>     * @since 1.0.10<a name="line.2679"></a>
<span class="sourceLineNo">2680</span>     */<a name="line.2680"></a>
<span class="sourceLineNo">2681</span>    public boolean removeDomainMarker(int index, Marker marker, Layer layer,<a name="line.2681"></a>
<span class="sourceLineNo">2682</span>            boolean notify) {<a name="line.2682"></a>
<span class="sourceLineNo">2683</span>        ArrayList markers;<a name="line.2683"></a>
<span class="sourceLineNo">2684</span>        if (layer == Layer.FOREGROUND) {<a name="line.2684"></a>
<span class="sourceLineNo">2685</span>            markers = (ArrayList) this.foregroundDomainMarkers.get(<a name="line.2685"></a>
<span class="sourceLineNo">2686</span>                    new Integer(index));<a name="line.2686"></a>
<span class="sourceLineNo">2687</span>        }<a name="line.2687"></a>
<span class="sourceLineNo">2688</span>        else {<a name="line.2688"></a>
<span class="sourceLineNo">2689</span>            markers = (ArrayList) this.backgroundDomainMarkers.get(<a name="line.2689"></a>
<span class="sourceLineNo">2690</span>                    new Integer(index));<a name="line.2690"></a>
<span class="sourceLineNo">2691</span>        }<a name="line.2691"></a>
<span class="sourceLineNo">2692</span>        if (markers == null) {<a name="line.2692"></a>
<span class="sourceLineNo">2693</span>            return false;<a name="line.2693"></a>
<span class="sourceLineNo">2694</span>        }<a name="line.2694"></a>
<span class="sourceLineNo">2695</span>        boolean removed = markers.remove(marker);<a name="line.2695"></a>
<span class="sourceLineNo">2696</span>        if (removed &amp;&amp; notify) {<a name="line.2696"></a>
<span class="sourceLineNo">2697</span>            fireChangeEvent();<a name="line.2697"></a>
<span class="sourceLineNo">2698</span>        }<a name="line.2698"></a>
<span class="sourceLineNo">2699</span>        return removed;<a name="line.2699"></a>
<span class="sourceLineNo">2700</span>    }<a name="line.2700"></a>
<span class="sourceLineNo">2701</span><a name="line.2701"></a>
<span class="sourceLineNo">2702</span>    /**<a name="line.2702"></a>
<span class="sourceLineNo">2703</span>     * Adds a marker for the range axis and sends a {@link PlotChangeEvent} to<a name="line.2703"></a>
<span class="sourceLineNo">2704</span>     * all registered listeners.<a name="line.2704"></a>
<span class="sourceLineNo">2705</span>     * &lt;P&gt;<a name="line.2705"></a>
<span class="sourceLineNo">2706</span>     * Typically a marker will be drawn by the renderer as a line perpendicular<a name="line.2706"></a>
<span class="sourceLineNo">2707</span>     * to the range axis, however this is entirely up to the renderer.<a name="line.2707"></a>
<span class="sourceLineNo">2708</span>     *<a name="line.2708"></a>
<span class="sourceLineNo">2709</span>     * @param marker  the marker (&lt;code&gt;null&lt;/code&gt; not permitted).<a name="line.2709"></a>
<span class="sourceLineNo">2710</span>     *<a name="line.2710"></a>
<span class="sourceLineNo">2711</span>     * @see #addRangeMarker(Marker, Layer)<a name="line.2711"></a>
<span class="sourceLineNo">2712</span>     */<a name="line.2712"></a>
<span class="sourceLineNo">2713</span>    public void addRangeMarker(Marker marker) {<a name="line.2713"></a>
<span class="sourceLineNo">2714</span>        addRangeMarker(marker, Layer.FOREGROUND);<a name="line.2714"></a>
<span class="sourceLineNo">2715</span>    }<a name="line.2715"></a>
<span class="sourceLineNo">2716</span><a name="line.2716"></a>
<span class="sourceLineNo">2717</span>    /**<a name="line.2717"></a>
<span class="sourceLineNo">2718</span>     * Adds a marker for the range axis in the specified layer and sends a<a name="line.2718"></a>
<span class="sourceLineNo">2719</span>     * {@link PlotChangeEvent} to all registered listeners.<a name="line.2719"></a>
<span class="sourceLineNo">2720</span>     * &lt;P&gt;<a name="line.2720"></a>
<span class="sourceLineNo">2721</span>     * Typically a marker will be drawn by the renderer as a line perpendicular<a name="line.2721"></a>
<span class="sourceLineNo">2722</span>     * to the range axis, however this is entirely up to the renderer.<a name="line.2722"></a>
<span class="sourceLineNo">2723</span>     *<a name="line.2723"></a>
<span class="sourceLineNo">2724</span>     * @param marker  the marker (&lt;code&gt;null&lt;/code&gt; not permitted).<a name="line.2724"></a>
<span class="sourceLineNo">2725</span>     * @param layer  the layer (foreground or background).<a name="line.2725"></a>
<span class="sourceLineNo">2726</span>     *<a name="line.2726"></a>
<span class="sourceLineNo">2727</span>     * @see #addRangeMarker(int, Marker, Layer)<a name="line.2727"></a>
<span class="sourceLineNo">2728</span>     */<a name="line.2728"></a>
<span class="sourceLineNo">2729</span>    public void addRangeMarker(Marker marker, Layer layer) {<a name="line.2729"></a>
<span class="sourceLineNo">2730</span>        addRangeMarker(0, marker, layer);<a name="line.2730"></a>
<span class="sourceLineNo">2731</span>    }<a name="line.2731"></a>
<span class="sourceLineNo">2732</span><a name="line.2732"></a>
<span class="sourceLineNo">2733</span>    /**<a name="line.2733"></a>
<span class="sourceLineNo">2734</span>     * Clears all the range markers and sends a {@link PlotChangeEvent} to all<a name="line.2734"></a>
<span class="sourceLineNo">2735</span>     * registered listeners.<a name="line.2735"></a>
<span class="sourceLineNo">2736</span>     *<a name="line.2736"></a>
<span class="sourceLineNo">2737</span>     * @see #clearRangeMarkers()<a name="line.2737"></a>
<span class="sourceLineNo">2738</span>     */<a name="line.2738"></a>
<span class="sourceLineNo">2739</span>    public void clearRangeMarkers() {<a name="line.2739"></a>
<span class="sourceLineNo">2740</span>        if (this.backgroundRangeMarkers != null) {<a name="line.2740"></a>
<span class="sourceLineNo">2741</span>            Set keys = this.backgroundRangeMarkers.keySet();<a name="line.2741"></a>
<span class="sourceLineNo">2742</span>            Iterator iterator = keys.iterator();<a name="line.2742"></a>
<span class="sourceLineNo">2743</span>            while (iterator.hasNext()) {<a name="line.2743"></a>
<span class="sourceLineNo">2744</span>                Integer key = (Integer) iterator.next();<a name="line.2744"></a>
<span class="sourceLineNo">2745</span>                clearRangeMarkers(key.intValue());<a name="line.2745"></a>
<span class="sourceLineNo">2746</span>            }<a name="line.2746"></a>
<span class="sourceLineNo">2747</span>            this.backgroundRangeMarkers.clear();<a name="line.2747"></a>
<span class="sourceLineNo">2748</span>        }<a name="line.2748"></a>
<span class="sourceLineNo">2749</span>        if (this.foregroundRangeMarkers != null) {<a name="line.2749"></a>
<span class="sourceLineNo">2750</span>            Set keys = this.foregroundRangeMarkers.keySet();<a name="line.2750"></a>
<span class="sourceLineNo">2751</span>            Iterator iterator = keys.iterator();<a name="line.2751"></a>
<span class="sourceLineNo">2752</span>            while (iterator.hasNext()) {<a name="line.2752"></a>
<span class="sourceLineNo">2753</span>                Integer key = (Integer) iterator.next();<a name="line.2753"></a>
<span class="sourceLineNo">2754</span>                clearRangeMarkers(key.intValue());<a name="line.2754"></a>
<span class="sourceLineNo">2755</span>            }<a name="line.2755"></a>
<span class="sourceLineNo">2756</span>            this.foregroundRangeMarkers.clear();<a name="line.2756"></a>
<span class="sourceLineNo">2757</span>        }<a name="line.2757"></a>
<span class="sourceLineNo">2758</span>        fireChangeEvent();<a name="line.2758"></a>
<span class="sourceLineNo">2759</span>    }<a name="line.2759"></a>
<span class="sourceLineNo">2760</span><a name="line.2760"></a>
<span class="sourceLineNo">2761</span>    /**<a name="line.2761"></a>
<span class="sourceLineNo">2762</span>     * Adds a marker for a specific dataset/renderer and sends a<a name="line.2762"></a>
<span class="sourceLineNo">2763</span>     * {@link PlotChangeEvent} to all registered listeners.<a name="line.2763"></a>
<span class="sourceLineNo">2764</span>     * &lt;P&gt;<a name="line.2764"></a>
<span class="sourceLineNo">2765</span>     * Typically a marker will be drawn by the renderer as a line perpendicular<a name="line.2765"></a>
<span class="sourceLineNo">2766</span>     * to the range axis, however this is entirely up to the renderer.<a name="line.2766"></a>
<span class="sourceLineNo">2767</span>     *<a name="line.2767"></a>
<span class="sourceLineNo">2768</span>     * @param index  the dataset/renderer index.<a name="line.2768"></a>
<span class="sourceLineNo">2769</span>     * @param marker  the marker.<a name="line.2769"></a>
<span class="sourceLineNo">2770</span>     * @param layer  the layer (foreground or background).<a name="line.2770"></a>
<span class="sourceLineNo">2771</span>     *<a name="line.2771"></a>
<span class="sourceLineNo">2772</span>     * @see #clearRangeMarkers(int)<a name="line.2772"></a>
<span class="sourceLineNo">2773</span>     * @see #addDomainMarker(int, Marker, Layer)<a name="line.2773"></a>
<span class="sourceLineNo">2774</span>     */<a name="line.2774"></a>
<span class="sourceLineNo">2775</span>    public void addRangeMarker(int index, Marker marker, Layer layer) {<a name="line.2775"></a>
<span class="sourceLineNo">2776</span>        addRangeMarker(index, marker, layer, true);<a name="line.2776"></a>
<span class="sourceLineNo">2777</span>    }<a name="line.2777"></a>
<span class="sourceLineNo">2778</span><a name="line.2778"></a>
<span class="sourceLineNo">2779</span>    /**<a name="line.2779"></a>
<span class="sourceLineNo">2780</span>     * Adds a marker for a specific dataset/renderer and, if requested, sends a<a name="line.2780"></a>
<span class="sourceLineNo">2781</span>     * {@link PlotChangeEvent} to all registered listeners.<a name="line.2781"></a>
<span class="sourceLineNo">2782</span>     * &lt;P&gt;<a name="line.2782"></a>
<span class="sourceLineNo">2783</span>     * Typically a marker will be drawn by the renderer as a line perpendicular<a name="line.2783"></a>
<span class="sourceLineNo">2784</span>     * to the range axis, however this is entirely up to the renderer.<a name="line.2784"></a>
<span class="sourceLineNo">2785</span>     *<a name="line.2785"></a>
<span class="sourceLineNo">2786</span>     * @param index  the dataset/renderer index.<a name="line.2786"></a>
<span class="sourceLineNo">2787</span>     * @param marker  the marker.<a name="line.2787"></a>
<span class="sourceLineNo">2788</span>     * @param layer  the layer (foreground or background).<a name="line.2788"></a>
<span class="sourceLineNo">2789</span>     * @param notify  notify listeners?<a name="line.2789"></a>
<span class="sourceLineNo">2790</span>     *<a name="line.2790"></a>
<span class="sourceLineNo">2791</span>     * @since 1.0.10<a name="line.2791"></a>
<span class="sourceLineNo">2792</span>     */<a name="line.2792"></a>
<span class="sourceLineNo">2793</span>    public void addRangeMarker(int index, Marker marker, Layer layer,<a name="line.2793"></a>
<span class="sourceLineNo">2794</span>            boolean notify) {<a name="line.2794"></a>
<span class="sourceLineNo">2795</span>        Collection markers;<a name="line.2795"></a>
<span class="sourceLineNo">2796</span>        if (layer == Layer.FOREGROUND) {<a name="line.2796"></a>
<span class="sourceLineNo">2797</span>            markers = (Collection) this.foregroundRangeMarkers.get(<a name="line.2797"></a>
<span class="sourceLineNo">2798</span>                    new Integer(index));<a name="line.2798"></a>
<span class="sourceLineNo">2799</span>            if (markers == null) {<a name="line.2799"></a>
<span class="sourceLineNo">2800</span>                markers = new java.util.ArrayList();<a name="line.2800"></a>
<span class="sourceLineNo">2801</span>                this.foregroundRangeMarkers.put(new Integer(index), markers);<a name="line.2801"></a>
<span class="sourceLineNo">2802</span>            }<a name="line.2802"></a>
<span class="sourceLineNo">2803</span>            markers.add(marker);<a name="line.2803"></a>
<span class="sourceLineNo">2804</span>        }<a name="line.2804"></a>
<span class="sourceLineNo">2805</span>        else if (layer == Layer.BACKGROUND) {<a name="line.2805"></a>
<span class="sourceLineNo">2806</span>            markers = (Collection) this.backgroundRangeMarkers.get(<a name="line.2806"></a>
<span class="sourceLineNo">2807</span>                    new Integer(index));<a name="line.2807"></a>
<span class="sourceLineNo">2808</span>            if (markers == null) {<a name="line.2808"></a>
<span class="sourceLineNo">2809</span>                markers = new java.util.ArrayList();<a name="line.2809"></a>
<span class="sourceLineNo">2810</span>                this.backgroundRangeMarkers.put(new Integer(index), markers);<a name="line.2810"></a>
<span class="sourceLineNo">2811</span>            }<a name="line.2811"></a>
<span class="sourceLineNo">2812</span>            markers.add(marker);<a name="line.2812"></a>
<span class="sourceLineNo">2813</span>        }<a name="line.2813"></a>
<span class="sourceLineNo">2814</span>        marker.addChangeListener(this);<a name="line.2814"></a>
<span class="sourceLineNo">2815</span>        if (notify) {<a name="line.2815"></a>
<span class="sourceLineNo">2816</span>            fireChangeEvent();<a name="line.2816"></a>
<span class="sourceLineNo">2817</span>        }<a name="line.2817"></a>
<span class="sourceLineNo">2818</span>    }<a name="line.2818"></a>
<span class="sourceLineNo">2819</span><a name="line.2819"></a>
<span class="sourceLineNo">2820</span>    /**<a name="line.2820"></a>
<span class="sourceLineNo">2821</span>     * Clears the (foreground and background) range markers for a particular<a name="line.2821"></a>
<span class="sourceLineNo">2822</span>     * renderer.<a name="line.2822"></a>
<span class="sourceLineNo">2823</span>     *<a name="line.2823"></a>
<span class="sourceLineNo">2824</span>     * @param index  the renderer index.<a name="line.2824"></a>
<span class="sourceLineNo">2825</span>     */<a name="line.2825"></a>
<span class="sourceLineNo">2826</span>    public void clearRangeMarkers(int index) {<a name="line.2826"></a>
<span class="sourceLineNo">2827</span>        Integer key = new Integer(index);<a name="line.2827"></a>
<span class="sourceLineNo">2828</span>        if (this.backgroundRangeMarkers != null) {<a name="line.2828"></a>
<span class="sourceLineNo">2829</span>            Collection markers<a name="line.2829"></a>
<span class="sourceLineNo">2830</span>                = (Collection) this.backgroundRangeMarkers.get(key);<a name="line.2830"></a>
<span class="sourceLineNo">2831</span>            if (markers != null) {<a name="line.2831"></a>
<span class="sourceLineNo">2832</span>                Iterator iterator = markers.iterator();<a name="line.2832"></a>
<span class="sourceLineNo">2833</span>                while (iterator.hasNext()) {<a name="line.2833"></a>
<span class="sourceLineNo">2834</span>                    Marker m = (Marker) iterator.next();<a name="line.2834"></a>
<span class="sourceLineNo">2835</span>                    m.removeChangeListener(this);<a name="line.2835"></a>
<span class="sourceLineNo">2836</span>                }<a name="line.2836"></a>
<span class="sourceLineNo">2837</span>                markers.clear();<a name="line.2837"></a>
<span class="sourceLineNo">2838</span>            }<a name="line.2838"></a>
<span class="sourceLineNo">2839</span>        }<a name="line.2839"></a>
<span class="sourceLineNo">2840</span>        if (this.foregroundRangeMarkers != null) {<a name="line.2840"></a>
<span class="sourceLineNo">2841</span>            Collection markers<a name="line.2841"></a>
<span class="sourceLineNo">2842</span>                = (Collection) this.foregroundRangeMarkers.get(key);<a name="line.2842"></a>
<span class="sourceLineNo">2843</span>            if (markers != null) {<a name="line.2843"></a>
<span class="sourceLineNo">2844</span>                Iterator iterator = markers.iterator();<a name="line.2844"></a>
<span class="sourceLineNo">2845</span>                while (iterator.hasNext()) {<a name="line.2845"></a>
<span class="sourceLineNo">2846</span>                    Marker m = (Marker) iterator.next();<a name="line.2846"></a>
<span class="sourceLineNo">2847</span>                    m.removeChangeListener(this);<a name="line.2847"></a>
<span class="sourceLineNo">2848</span>                }<a name="line.2848"></a>
<span class="sourceLineNo">2849</span>                markers.clear();<a name="line.2849"></a>
<span class="sourceLineNo">2850</span>            }<a name="line.2850"></a>
<span class="sourceLineNo">2851</span>        }<a name="line.2851"></a>
<span class="sourceLineNo">2852</span>        fireChangeEvent();<a name="line.2852"></a>
<span class="sourceLineNo">2853</span>    }<a name="line.2853"></a>
<span class="sourceLineNo">2854</span><a name="line.2854"></a>
<span class="sourceLineNo">2855</span>    /**<a name="line.2855"></a>
<span class="sourceLineNo">2856</span>     * Removes a marker for the range axis and sends a {@link PlotChangeEvent}<a name="line.2856"></a>
<span class="sourceLineNo">2857</span>     * to all registered listeners.<a name="line.2857"></a>
<span class="sourceLineNo">2858</span>     *<a name="line.2858"></a>
<span class="sourceLineNo">2859</span>     * @param marker the marker.<a name="line.2859"></a>
<span class="sourceLineNo">2860</span>     *<a name="line.2860"></a>
<span class="sourceLineNo">2861</span>     * @return A boolean indicating whether or not the marker was actually<a name="line.2861"></a>
<span class="sourceLineNo">2862</span>     *         removed.<a name="line.2862"></a>
<span class="sourceLineNo">2863</span>     *<a name="line.2863"></a>
<span class="sourceLineNo">2864</span>     * @since 1.0.7<a name="line.2864"></a>
<span class="sourceLineNo">2865</span>     */<a name="line.2865"></a>
<span class="sourceLineNo">2866</span>    public boolean removeRangeMarker(Marker marker) {<a name="line.2866"></a>
<span class="sourceLineNo">2867</span>        return removeRangeMarker(marker, Layer.FOREGROUND);<a name="line.2867"></a>
<span class="sourceLineNo">2868</span>    }<a name="line.2868"></a>
<span class="sourceLineNo">2869</span><a name="line.2869"></a>
<span class="sourceLineNo">2870</span>    /**<a name="line.2870"></a>
<span class="sourceLineNo">2871</span>     * Removes a marker for the range axis in the specified layer and sends a<a name="line.2871"></a>
<span class="sourceLineNo">2872</span>     * {@link PlotChangeEvent} to all registered listeners.<a name="line.2872"></a>
<span class="sourceLineNo">2873</span>     *<a name="line.2873"></a>
<span class="sourceLineNo">2874</span>     * @param marker the marker (&lt;code&gt;null&lt;/code&gt; not permitted).<a name="line.2874"></a>
<span class="sourceLineNo">2875</span>     * @param layer the layer (foreground or background).<a name="line.2875"></a>
<span class="sourceLineNo">2876</span>     *<a name="line.2876"></a>
<span class="sourceLineNo">2877</span>     * @return A boolean indicating whether or not the marker was actually<a name="line.2877"></a>
<span class="sourceLineNo">2878</span>     *         removed.<a name="line.2878"></a>
<span class="sourceLineNo">2879</span>     *<a name="line.2879"></a>
<span class="sourceLineNo">2880</span>     * @since 1.0.7<a name="line.2880"></a>
<span class="sourceLineNo">2881</span>     */<a name="line.2881"></a>
<span class="sourceLineNo">2882</span>    public boolean removeRangeMarker(Marker marker, Layer layer) {<a name="line.2882"></a>
<span class="sourceLineNo">2883</span>        return removeRangeMarker(0, marker, layer);<a name="line.2883"></a>
<span class="sourceLineNo">2884</span>    }<a name="line.2884"></a>
<span class="sourceLineNo">2885</span><a name="line.2885"></a>
<span class="sourceLineNo">2886</span>    /**<a name="line.2886"></a>
<span class="sourceLineNo">2887</span>     * Removes a marker for a specific dataset/renderer and sends a<a name="line.2887"></a>
<span class="sourceLineNo">2888</span>     * {@link PlotChangeEvent} to all registered listeners.<a name="line.2888"></a>
<span class="sourceLineNo">2889</span>     *<a name="line.2889"></a>
<span class="sourceLineNo">2890</span>     * @param index the dataset/renderer index.<a name="line.2890"></a>
<span class="sourceLineNo">2891</span>     * @param marker the marker.<a name="line.2891"></a>
<span class="sourceLineNo">2892</span>     * @param layer the layer (foreground or background).<a name="line.2892"></a>
<span class="sourceLineNo">2893</span>     *<a name="line.2893"></a>
<span class="sourceLineNo">2894</span>     * @return A boolean indicating whether or not the marker was actually<a name="line.2894"></a>
<span class="sourceLineNo">2895</span>     *         removed.<a name="line.2895"></a>
<span class="sourceLineNo">2896</span>     *<a name="line.2896"></a>
<span class="sourceLineNo">2897</span>     * @since 1.0.7<a name="line.2897"></a>
<span class="sourceLineNo">2898</span>     */<a name="line.2898"></a>
<span class="sourceLineNo">2899</span>    public boolean removeRangeMarker(int index, Marker marker, Layer layer) {<a name="line.2899"></a>
<span class="sourceLineNo">2900</span>        return removeRangeMarker(index, marker, layer, true);<a name="line.2900"></a>
<span class="sourceLineNo">2901</span>    }<a name="line.2901"></a>
<span class="sourceLineNo">2902</span><a name="line.2902"></a>
<span class="sourceLineNo">2903</span>    /**<a name="line.2903"></a>
<span class="sourceLineNo">2904</span>     * Removes a marker for a specific dataset/renderer and sends a<a name="line.2904"></a>
<span class="sourceLineNo">2905</span>     * {@link PlotChangeEvent} to all registered listeners.<a name="line.2905"></a>
<span class="sourceLineNo">2906</span>     *<a name="line.2906"></a>
<span class="sourceLineNo">2907</span>     * @param index  the dataset/renderer index.<a name="line.2907"></a>
<span class="sourceLineNo">2908</span>     * @param marker  the marker.<a name="line.2908"></a>
<span class="sourceLineNo">2909</span>     * @param layer  the layer (foreground or background).<a name="line.2909"></a>
<span class="sourceLineNo">2910</span>     * @param notify  notify listeners?<a name="line.2910"></a>
<span class="sourceLineNo">2911</span>     *<a name="line.2911"></a>
<span class="sourceLineNo">2912</span>     * @return A boolean indicating whether or not the marker was actually<a name="line.2912"></a>
<span class="sourceLineNo">2913</span>     *         removed.<a name="line.2913"></a>
<span class="sourceLineNo">2914</span>     *<a name="line.2914"></a>
<span class="sourceLineNo">2915</span>     * @since 1.0.10<a name="line.2915"></a>
<span class="sourceLineNo">2916</span>     */<a name="line.2916"></a>
<span class="sourceLineNo">2917</span>    public boolean removeRangeMarker(int index, Marker marker, Layer layer,<a name="line.2917"></a>
<span class="sourceLineNo">2918</span>            boolean notify) {<a name="line.2918"></a>
<span class="sourceLineNo">2919</span>        if (marker == null) {<a name="line.2919"></a>
<span class="sourceLineNo">2920</span>            throw new IllegalArgumentException("Null 'marker' argument.");<a name="line.2920"></a>
<span class="sourceLineNo">2921</span>        }<a name="line.2921"></a>
<span class="sourceLineNo">2922</span>        ArrayList markers;<a name="line.2922"></a>
<span class="sourceLineNo">2923</span>        if (layer == Layer.FOREGROUND) {<a name="line.2923"></a>
<span class="sourceLineNo">2924</span>            markers = (ArrayList) this.foregroundRangeMarkers.get(<a name="line.2924"></a>
<span class="sourceLineNo">2925</span>                    new Integer(index));<a name="line.2925"></a>
<span class="sourceLineNo">2926</span>        }<a name="line.2926"></a>
<span class="sourceLineNo">2927</span>        else {<a name="line.2927"></a>
<span class="sourceLineNo">2928</span>            markers = (ArrayList) this.backgroundRangeMarkers.get(<a name="line.2928"></a>
<span class="sourceLineNo">2929</span>                    new Integer(index));<a name="line.2929"></a>
<span class="sourceLineNo">2930</span>        }<a name="line.2930"></a>
<span class="sourceLineNo">2931</span>        if (markers == null) {<a name="line.2931"></a>
<span class="sourceLineNo">2932</span>            return false;<a name="line.2932"></a>
<span class="sourceLineNo">2933</span>        }<a name="line.2933"></a>
<span class="sourceLineNo">2934</span>        boolean removed = markers.remove(marker);<a name="line.2934"></a>
<span class="sourceLineNo">2935</span>        if (removed &amp;&amp; notify) {<a name="line.2935"></a>
<span class="sourceLineNo">2936</span>            fireChangeEvent();<a name="line.2936"></a>
<span class="sourceLineNo">2937</span>        }<a name="line.2937"></a>
<span class="sourceLineNo">2938</span>        return removed;<a name="line.2938"></a>
<span class="sourceLineNo">2939</span>    }<a name="line.2939"></a>
<span class="sourceLineNo">2940</span><a name="line.2940"></a>
<span class="sourceLineNo">2941</span>    /**<a name="line.2941"></a>
<span class="sourceLineNo">2942</span>     * Adds an annotation to the plot and sends a {@link PlotChangeEvent} to<a name="line.2942"></a>
<span class="sourceLineNo">2943</span>     * all registered listeners.<a name="line.2943"></a>
<span class="sourceLineNo">2944</span>     *<a name="line.2944"></a>
<span class="sourceLineNo">2945</span>     * @param annotation  the annotation (&lt;code&gt;null&lt;/code&gt; not permitted).<a name="line.2945"></a>
<span class="sourceLineNo">2946</span>     *<a name="line.2946"></a>
<span class="sourceLineNo">2947</span>     * @see #getAnnotations()<a name="line.2947"></a>
<span class="sourceLineNo">2948</span>     * @see #removeAnnotation(XYAnnotation)<a name="line.2948"></a>
<span class="sourceLineNo">2949</span>     */<a name="line.2949"></a>
<span class="sourceLineNo">2950</span>    public void addAnnotation(XYAnnotation annotation) {<a name="line.2950"></a>
<span class="sourceLineNo">2951</span>        addAnnotation(annotation, true);<a name="line.2951"></a>
<span class="sourceLineNo">2952</span>    }<a name="line.2952"></a>
<span class="sourceLineNo">2953</span><a name="line.2953"></a>
<span class="sourceLineNo">2954</span>    /**<a name="line.2954"></a>
<span class="sourceLineNo">2955</span>     * Adds an annotation to the plot and, if requested, sends a<a name="line.2955"></a>
<span class="sourceLineNo">2956</span>     * {@link PlotChangeEvent} to all registered listeners.<a name="line.2956"></a>
<span class="sourceLineNo">2957</span>     *<a name="line.2957"></a>
<span class="sourceLineNo">2958</span>     * @param annotation  the annotation (&lt;code&gt;null&lt;/code&gt; not permitted).<a name="line.2958"></a>
<span class="sourceLineNo">2959</span>     * @param notify  notify listeners?<a name="line.2959"></a>
<span class="sourceLineNo">2960</span>     *<a name="line.2960"></a>
<span class="sourceLineNo">2961</span>     * @since 1.0.10<a name="line.2961"></a>
<span class="sourceLineNo">2962</span>     */<a name="line.2962"></a>
<span class="sourceLineNo">2963</span>    public void addAnnotation(XYAnnotation annotation, boolean notify) {<a name="line.2963"></a>
<span class="sourceLineNo">2964</span>        if (annotation == null) {<a name="line.2964"></a>
<span class="sourceLineNo">2965</span>            throw new IllegalArgumentException("Null 'annotation' argument.");<a name="line.2965"></a>
<span class="sourceLineNo">2966</span>        }<a name="line.2966"></a>
<span class="sourceLineNo">2967</span>        this.annotations.add(annotation);<a name="line.2967"></a>
<span class="sourceLineNo">2968</span>        annotation.addChangeListener(this);<a name="line.2968"></a>
<span class="sourceLineNo">2969</span>        if (notify) {<a name="line.2969"></a>
<span class="sourceLineNo">2970</span>            fireChangeEvent();<a name="line.2970"></a>
<span class="sourceLineNo">2971</span>        }<a name="line.2971"></a>
<span class="sourceLineNo">2972</span>    }<a name="line.2972"></a>
<span class="sourceLineNo">2973</span><a name="line.2973"></a>
<span class="sourceLineNo">2974</span>    /**<a name="line.2974"></a>
<span class="sourceLineNo">2975</span>     * Removes an annotation from the plot and sends a {@link PlotChangeEvent}<a name="line.2975"></a>
<span class="sourceLineNo">2976</span>     * to all registered listeners.<a name="line.2976"></a>
<span class="sourceLineNo">2977</span>     *<a name="line.2977"></a>
<span class="sourceLineNo">2978</span>     * @param annotation  the annotation (&lt;code&gt;null&lt;/code&gt; not permitted).<a name="line.2978"></a>
<span class="sourceLineNo">2979</span>     *<a name="line.2979"></a>
<span class="sourceLineNo">2980</span>     * @return A boolean (indicates whether or not the annotation was removed).<a name="line.2980"></a>
<span class="sourceLineNo">2981</span>     *<a name="line.2981"></a>
<span class="sourceLineNo">2982</span>     * @see #addAnnotation(XYAnnotation)<a name="line.2982"></a>
<span class="sourceLineNo">2983</span>     * @see #getAnnotations()<a name="line.2983"></a>
<span class="sourceLineNo">2984</span>     */<a name="line.2984"></a>
<span class="sourceLineNo">2985</span>    public boolean removeAnnotation(XYAnnotation annotation) {<a name="line.2985"></a>
<span class="sourceLineNo">2986</span>        return removeAnnotation(annotation, true);<a name="line.2986"></a>
<span class="sourceLineNo">2987</span>    }<a name="line.2987"></a>
<span class="sourceLineNo">2988</span><a name="line.2988"></a>
<span class="sourceLineNo">2989</span>    /**<a name="line.2989"></a>
<span class="sourceLineNo">2990</span>     * Removes an annotation from the plot and sends a {@link PlotChangeEvent}<a name="line.2990"></a>
<span class="sourceLineNo">2991</span>     * to all registered listeners.<a name="line.2991"></a>
<span class="sourceLineNo">2992</span>     *<a name="line.2992"></a>
<span class="sourceLineNo">2993</span>     * @param annotation  the annotation (&lt;code&gt;null&lt;/code&gt; not permitted).<a name="line.2993"></a>
<span class="sourceLineNo">2994</span>     * @param notify  notify listeners?<a name="line.2994"></a>
<span class="sourceLineNo">2995</span>     *<a name="line.2995"></a>
<span class="sourceLineNo">2996</span>     * @return A boolean (indicates whether or not the annotation was removed).<a name="line.2996"></a>
<span class="sourceLineNo">2997</span>     *<a name="line.2997"></a>
<span class="sourceLineNo">2998</span>     * @since 1.0.10<a name="line.2998"></a>
<span class="sourceLineNo">2999</span>     */<a name="line.2999"></a>
<span class="sourceLineNo">3000</span>    public boolean removeAnnotation(XYAnnotation annotation, boolean notify) {<a name="line.3000"></a>
<span class="sourceLineNo">3001</span>        if (annotation == null) {<a name="line.3001"></a>
<span class="sourceLineNo">3002</span>            throw new IllegalArgumentException("Null 'annotation' argument.");<a name="line.3002"></a>
<span class="sourceLineNo">3003</span>        }<a name="line.3003"></a>
<span class="sourceLineNo">3004</span>        boolean removed = this.annotations.remove(annotation);<a name="line.3004"></a>
<span class="sourceLineNo">3005</span>        annotation.removeChangeListener(this);<a name="line.3005"></a>
<span class="sourceLineNo">3006</span>        if (removed &amp;&amp; notify) {<a name="line.3006"></a>
<span class="sourceLineNo">3007</span>            fireChangeEvent();<a name="line.3007"></a>
<span class="sourceLineNo">3008</span>        }<a name="line.3008"></a>
<span class="sourceLineNo">3009</span>        return removed;<a name="line.3009"></a>
<span class="sourceLineNo">3010</span>    }<a name="line.3010"></a>
<span class="sourceLineNo">3011</span><a name="line.3011"></a>
<span class="sourceLineNo">3012</span>    /**<a name="line.3012"></a>
<span class="sourceLineNo">3013</span>     * Returns the list of annotations.<a name="line.3013"></a>
<span class="sourceLineNo">3014</span>     *<a name="line.3014"></a>
<span class="sourceLineNo">3015</span>     * @return The list of annotations.<a name="line.3015"></a>
<span class="sourceLineNo">3016</span>     *<a name="line.3016"></a>
<span class="sourceLineNo">3017</span>     * @since 1.0.1<a name="line.3017"></a>
<span class="sourceLineNo">3018</span>     *<a name="line.3018"></a>
<span class="sourceLineNo">3019</span>     * @see #addAnnotation(XYAnnotation)<a name="line.3019"></a>
<span class="sourceLineNo">3020</span>     */<a name="line.3020"></a>
<span class="sourceLineNo">3021</span>    public List getAnnotations() {<a name="line.3021"></a>
<span class="sourceLineNo">3022</span>        return new ArrayList(this.annotations);<a name="line.3022"></a>
<span class="sourceLineNo">3023</span>    }<a name="line.3023"></a>
<span class="sourceLineNo">3024</span><a name="line.3024"></a>
<span class="sourceLineNo">3025</span>    /**<a name="line.3025"></a>
<span class="sourceLineNo">3026</span>     * Clears all the annotations and sends a {@link PlotChangeEvent} to all<a name="line.3026"></a>
<span class="sourceLineNo">3027</span>     * registered listeners.<a name="line.3027"></a>
<span class="sourceLineNo">3028</span>     *<a name="line.3028"></a>
<span class="sourceLineNo">3029</span>     * @see #addAnnotation(XYAnnotation)<a name="line.3029"></a>
<span class="sourceLineNo">3030</span>     */<a name="line.3030"></a>
<span class="sourceLineNo">3031</span>    public void clearAnnotations() {<a name="line.3031"></a>
<span class="sourceLineNo">3032</span>        for(int i = 0; i &lt; this.annotations.size(); i++){<a name="line.3032"></a>
<span class="sourceLineNo">3033</span>            XYAnnotation annotation = (XYAnnotation) this.annotations.get(i);<a name="line.3033"></a>
<span class="sourceLineNo">3034</span>            annotation.removeChangeListener(this);<a name="line.3034"></a>
<span class="sourceLineNo">3035</span>        }<a name="line.3035"></a>
<span class="sourceLineNo">3036</span>        this.annotations.clear();<a name="line.3036"></a>
<span class="sourceLineNo">3037</span>        fireChangeEvent();<a name="line.3037"></a>
<span class="sourceLineNo">3038</span>    }<a name="line.3038"></a>
<span class="sourceLineNo">3039</span><a name="line.3039"></a>
<span class="sourceLineNo">3040</span>    /**<a name="line.3040"></a>
<span class="sourceLineNo">3041</span>     * Returns the shadow generator for the plot, if any.<a name="line.3041"></a>
<span class="sourceLineNo">3042</span>     *<a name="line.3042"></a>
<span class="sourceLineNo">3043</span>     * @return The shadow generator (possibly &lt;code&gt;null&lt;/code&gt;).<a name="line.3043"></a>
<span class="sourceLineNo">3044</span>     *<a name="line.3044"></a>
<span class="sourceLineNo">3045</span>     * @since 1.0.14<a name="line.3045"></a>
<span class="sourceLineNo">3046</span>     */<a name="line.3046"></a>
<span class="sourceLineNo">3047</span>    public ShadowGenerator getShadowGenerator() {<a name="line.3047"></a>
<span class="sourceLineNo">3048</span>        return this.shadowGenerator;<a name="line.3048"></a>
<span class="sourceLineNo">3049</span>    }<a name="line.3049"></a>
<span class="sourceLineNo">3050</span><a name="line.3050"></a>
<span class="sourceLineNo">3051</span>    /**<a name="line.3051"></a>
<span class="sourceLineNo">3052</span>     * Sets the shadow generator for the plot and sends a<a name="line.3052"></a>
<span class="sourceLineNo">3053</span>     * {@link PlotChangeEvent} to all registered listeners.<a name="line.3053"></a>
<span class="sourceLineNo">3054</span>     *<a name="line.3054"></a>
<span class="sourceLineNo">3055</span>     * @param generator  the generator (&lt;code&gt;null&lt;/code&gt; permitted).<a name="line.3055"></a>
<span class="sourceLineNo">3056</span>     *<a name="line.3056"></a>
<span class="sourceLineNo">3057</span>     * @since 1.0.14<a name="line.3057"></a>
<span class="sourceLineNo">3058</span>     */<a name="line.3058"></a>
<span class="sourceLineNo">3059</span>    public void setShadowGenerator(ShadowGenerator generator) {<a name="line.3059"></a>
<span class="sourceLineNo">3060</span>        this.shadowGenerator = generator;<a name="line.3060"></a>
<span class="sourceLineNo">3061</span>        fireChangeEvent();<a name="line.3061"></a>
<span class="sourceLineNo">3062</span>    }<a name="line.3062"></a>
<span class="sourceLineNo">3063</span><a name="line.3063"></a>
<span class="sourceLineNo">3064</span>    /**<a name="line.3064"></a>
<span class="sourceLineNo">3065</span>     * Calculates the space required for all the axes in the plot.<a name="line.3065"></a>
<span class="sourceLineNo">3066</span>     *<a name="line.3066"></a>
<span class="sourceLineNo">3067</span>     * @param g2  the graphics device.<a name="line.3067"></a>
<span class="sourceLineNo">3068</span>     * @param plotArea  the plot area.<a name="line.3068"></a>
<span class="sourceLineNo">3069</span>     *<a name="line.3069"></a>
<span class="sourceLineNo">3070</span>     * @return The required space.<a name="line.3070"></a>
<span class="sourceLineNo">3071</span>     */<a name="line.3071"></a>
<span class="sourceLineNo">3072</span>    protected AxisSpace calculateAxisSpace(Graphics2D g2,<a name="line.3072"></a>
<span class="sourceLineNo">3073</span>                                           Rectangle2D plotArea) {<a name="line.3073"></a>
<span class="sourceLineNo">3074</span>        AxisSpace space = new AxisSpace();<a name="line.3074"></a>
<span class="sourceLineNo">3075</span>        space = calculateRangeAxisSpace(g2, plotArea, space);<a name="line.3075"></a>
<span class="sourceLineNo">3076</span>        Rectangle2D revPlotArea = space.shrink(plotArea, null);<a name="line.3076"></a>
<span class="sourceLineNo">3077</span>        space = calculateDomainAxisSpace(g2, revPlotArea, space);<a name="line.3077"></a>
<span class="sourceLineNo">3078</span>        return space;<a name="line.3078"></a>
<span class="sourceLineNo">3079</span>    }<a name="line.3079"></a>
<span class="sourceLineNo">3080</span><a name="line.3080"></a>
<span class="sourceLineNo">3081</span>    /**<a name="line.3081"></a>
<span class="sourceLineNo">3082</span>     * Calculates the space required for the domain axis/axes.<a name="line.3082"></a>
<span class="sourceLineNo">3083</span>     *<a name="line.3083"></a>
<span class="sourceLineNo">3084</span>     * @param g2  the graphics device.<a name="line.3084"></a>
<span class="sourceLineNo">3085</span>     * @param plotArea  the plot area.<a name="line.3085"></a>
<span class="sourceLineNo">3086</span>     * @param space  a carrier for the result (&lt;code&gt;null&lt;/code&gt; permitted).<a name="line.3086"></a>
<span class="sourceLineNo">3087</span>     *<a name="line.3087"></a>
<span class="sourceLineNo">3088</span>     * @return The required space.<a name="line.3088"></a>
<span class="sourceLineNo">3089</span>     */<a name="line.3089"></a>
<span class="sourceLineNo">3090</span>    protected AxisSpace calculateDomainAxisSpace(Graphics2D g2,<a name="line.3090"></a>
<span class="sourceLineNo">3091</span>                                                 Rectangle2D plotArea,<a name="line.3091"></a>
<span class="sourceLineNo">3092</span>                                                 AxisSpace space) {<a name="line.3092"></a>
<span class="sourceLineNo">3093</span><a name="line.3093"></a>
<span class="sourceLineNo">3094</span>        if (space == null) {<a name="line.3094"></a>
<span class="sourceLineNo">3095</span>            space = new AxisSpace();<a name="line.3095"></a>
<span class="sourceLineNo">3096</span>        }<a name="line.3096"></a>
<span class="sourceLineNo">3097</span><a name="line.3097"></a>
<span class="sourceLineNo">3098</span>        // reserve some space for the domain axis...<a name="line.3098"></a>
<span class="sourceLineNo">3099</span>        if (this.fixedDomainAxisSpace != null) {<a name="line.3099"></a>
<span class="sourceLineNo">3100</span>            if (this.orientation == PlotOrientation.HORIZONTAL) {<a name="line.3100"></a>
<span class="sourceLineNo">3101</span>                space.ensureAtLeast(this.fixedDomainAxisSpace.getLeft(),<a name="line.3101"></a>
<span class="sourceLineNo">3102</span>                        RectangleEdge.LEFT);<a name="line.3102"></a>
<span class="sourceLineNo">3103</span>                space.ensureAtLeast(this.fixedDomainAxisSpace.getRight(),<a name="line.3103"></a>
<span class="sourceLineNo">3104</span>                        RectangleEdge.RIGHT);<a name="line.3104"></a>
<span class="sourceLineNo">3105</span>            }<a name="line.3105"></a>
<span class="sourceLineNo">3106</span>            else if (this.orientation == PlotOrientation.VERTICAL) {<a name="line.3106"></a>
<span class="sourceLineNo">3107</span>                space.ensureAtLeast(this.fixedDomainAxisSpace.getTop(),<a name="line.3107"></a>
<span class="sourceLineNo">3108</span>                        RectangleEdge.TOP);<a name="line.3108"></a>
<span class="sourceLineNo">3109</span>                space.ensureAtLeast(this.fixedDomainAxisSpace.getBottom(),<a name="line.3109"></a>
<span class="sourceLineNo">3110</span>                        RectangleEdge.BOTTOM);<a name="line.3110"></a>
<span class="sourceLineNo">3111</span>            }<a name="line.3111"></a>
<span class="sourceLineNo">3112</span>        }<a name="line.3112"></a>
<span class="sourceLineNo">3113</span>        else {<a name="line.3113"></a>
<span class="sourceLineNo">3114</span>            // reserve space for the domain axes...<a name="line.3114"></a>
<span class="sourceLineNo">3115</span>            for (int i = 0; i &lt; this.domainAxes.size(); i++) {<a name="line.3115"></a>
<span class="sourceLineNo">3116</span>                Axis axis = (Axis) this.domainAxes.get(i);<a name="line.3116"></a>
<span class="sourceLineNo">3117</span>                if (axis != null) {<a name="line.3117"></a>
<span class="sourceLineNo">3118</span>                    RectangleEdge edge = getDomainAxisEdge(i);<a name="line.3118"></a>
<span class="sourceLineNo">3119</span>                    space = axis.reserveSpace(g2, this, plotArea, edge, space);<a name="line.3119"></a>
<span class="sourceLineNo">3120</span>                }<a name="line.3120"></a>
<span class="sourceLineNo">3121</span>            }<a name="line.3121"></a>
<span class="sourceLineNo">3122</span>        }<a name="line.3122"></a>
<span class="sourceLineNo">3123</span><a name="line.3123"></a>
<span class="sourceLineNo">3124</span>        return space;<a name="line.3124"></a>
<span class="sourceLineNo">3125</span><a name="line.3125"></a>
<span class="sourceLineNo">3126</span>    }<a name="line.3126"></a>
<span class="sourceLineNo">3127</span><a name="line.3127"></a>
<span class="sourceLineNo">3128</span>    /**<a name="line.3128"></a>
<span class="sourceLineNo">3129</span>     * Calculates the space required for the range axis/axes.<a name="line.3129"></a>
<span class="sourceLineNo">3130</span>     *<a name="line.3130"></a>
<span class="sourceLineNo">3131</span>     * @param g2  the graphics device.<a name="line.3131"></a>
<span class="sourceLineNo">3132</span>     * @param plotArea  the plot area.<a name="line.3132"></a>
<span class="sourceLineNo">3133</span>     * @param space  a carrier for the result (&lt;code&gt;null&lt;/code&gt; permitted).<a name="line.3133"></a>
<span class="sourceLineNo">3134</span>     *<a name="line.3134"></a>
<span class="sourceLineNo">3135</span>     * @return The required space.<a name="line.3135"></a>
<span class="sourceLineNo">3136</span>     */<a name="line.3136"></a>
<span class="sourceLineNo">3137</span>    protected AxisSpace calculateRangeAxisSpace(Graphics2D g2,<a name="line.3137"></a>
<span class="sourceLineNo">3138</span>                                                Rectangle2D plotArea,<a name="line.3138"></a>
<span class="sourceLineNo">3139</span>                                                AxisSpace space) {<a name="line.3139"></a>
<span class="sourceLineNo">3140</span><a name="line.3140"></a>
<span class="sourceLineNo">3141</span>        if (space == null) {<a name="line.3141"></a>
<span class="sourceLineNo">3142</span>            space = new AxisSpace();<a name="line.3142"></a>
<span class="sourceLineNo">3143</span>        }<a name="line.3143"></a>
<span class="sourceLineNo">3144</span><a name="line.3144"></a>
<span class="sourceLineNo">3145</span>        // reserve some space for the range axis...<a name="line.3145"></a>
<span class="sourceLineNo">3146</span>        if (this.fixedRangeAxisSpace != null) {<a name="line.3146"></a>
<span class="sourceLineNo">3147</span>            if (this.orientation == PlotOrientation.HORIZONTAL) {<a name="line.3147"></a>
<span class="sourceLineNo">3148</span>                space.ensureAtLeast(this.fixedRangeAxisSpace.getTop(),<a name="line.3148"></a>
<span class="sourceLineNo">3149</span>                        RectangleEdge.TOP);<a name="line.3149"></a>
<span class="sourceLineNo">3150</span>                space.ensureAtLeast(this.fixedRangeAxisSpace.getBottom(),<a name="line.3150"></a>
<span class="sourceLineNo">3151</span>                        RectangleEdge.BOTTOM);<a name="line.3151"></a>
<span class="sourceLineNo">3152</span>            }<a name="line.3152"></a>
<span class="sourceLineNo">3153</span>            else if (this.orientation == PlotOrientation.VERTICAL) {<a name="line.3153"></a>
<span class="sourceLineNo">3154</span>                space.ensureAtLeast(this.fixedRangeAxisSpace.getLeft(),<a name="line.3154"></a>
<span class="sourceLineNo">3155</span>                        RectangleEdge.LEFT);<a name="line.3155"></a>
<span class="sourceLineNo">3156</span>                space.ensureAtLeast(this.fixedRangeAxisSpace.getRight(),<a name="line.3156"></a>
<span class="sourceLineNo">3157</span>                        RectangleEdge.RIGHT);<a name="line.3157"></a>
<span class="sourceLineNo">3158</span>            }<a name="line.3158"></a>
<span class="sourceLineNo">3159</span>        }<a name="line.3159"></a>
<span class="sourceLineNo">3160</span>        else {<a name="line.3160"></a>
<span class="sourceLineNo">3161</span>            // reserve space for the range axes...<a name="line.3161"></a>
<span class="sourceLineNo">3162</span>            for (int i = 0; i &lt; this.rangeAxes.size(); i++) {<a name="line.3162"></a>
<span class="sourceLineNo">3163</span>                Axis axis = (Axis) this.rangeAxes.get(i);<a name="line.3163"></a>
<span class="sourceLineNo">3164</span>                if (axis != null) {<a name="line.3164"></a>
<span class="sourceLineNo">3165</span>                    RectangleEdge edge = getRangeAxisEdge(i);<a name="line.3165"></a>
<span class="sourceLineNo">3166</span>                    space = axis.reserveSpace(g2, this, plotArea, edge, space);<a name="line.3166"></a>
<span class="sourceLineNo">3167</span>                }<a name="line.3167"></a>
<span class="sourceLineNo">3168</span>            }<a name="line.3168"></a>
<span class="sourceLineNo">3169</span>        }<a name="line.3169"></a>
<span class="sourceLineNo">3170</span>        return space;<a name="line.3170"></a>
<span class="sourceLineNo">3171</span><a name="line.3171"></a>
<span class="sourceLineNo">3172</span>    }<a name="line.3172"></a>
<span class="sourceLineNo">3173</span><a name="line.3173"></a>
<span class="sourceLineNo">3174</span>    /**<a name="line.3174"></a>
<span class="sourceLineNo">3175</span>     * Trims a rectangle to integer coordinates.<a name="line.3175"></a>
<span class="sourceLineNo">3176</span>     *<a name="line.3176"></a>
<span class="sourceLineNo">3177</span>     * @param rect  the incoming rectangle.<a name="line.3177"></a>
<span class="sourceLineNo">3178</span>     *<a name="line.3178"></a>
<span class="sourceLineNo">3179</span>     * @return A rectangle with integer coordinates.<a name="line.3179"></a>
<span class="sourceLineNo">3180</span>     */<a name="line.3180"></a>
<span class="sourceLineNo">3181</span>    private Rectangle integerise(Rectangle2D rect) {<a name="line.3181"></a>
<span class="sourceLineNo">3182</span>        int x0 = (int) Math.ceil(rect.getMinX());<a name="line.3182"></a>
<span class="sourceLineNo">3183</span>        int y0 = (int) Math.ceil(rect.getMinY());<a name="line.3183"></a>
<span class="sourceLineNo">3184</span>        int x1 = (int) Math.floor(rect.getMaxX());<a name="line.3184"></a>
<span class="sourceLineNo">3185</span>        int y1 = (int) Math.floor(rect.getMaxY());<a name="line.3185"></a>
<span class="sourceLineNo">3186</span>        return new Rectangle(x0, y0, (x1 - x0), (y1 - y0));<a name="line.3186"></a>
<span class="sourceLineNo">3187</span>    }<a name="line.3187"></a>
<span class="sourceLineNo">3188</span><a name="line.3188"></a>
<span class="sourceLineNo">3189</span>    /**<a name="line.3189"></a>
<span class="sourceLineNo">3190</span>     * Draws the plot within the specified area on a graphics device.<a name="line.3190"></a>
<span class="sourceLineNo">3191</span>     *<a name="line.3191"></a>
<span class="sourceLineNo">3192</span>     * @param g2  the graphics device.<a name="line.3192"></a>
<span class="sourceLineNo">3193</span>     * @param area  the plot area (in Java2D space).<a name="line.3193"></a>
<span class="sourceLineNo">3194</span>     * @param anchor  an anchor point in Java2D space (&lt;code&gt;null&lt;/code&gt;<a name="line.3194"></a>
<span class="sourceLineNo">3195</span>     *                permitted).<a name="line.3195"></a>
<span class="sourceLineNo">3196</span>     * @param parentState  the state from the parent plot, if there is one<a name="line.3196"></a>
<span class="sourceLineNo">3197</span>     *                     (&lt;code&gt;null&lt;/code&gt; permitted).<a name="line.3197"></a>
<span class="sourceLineNo">3198</span>     * @param info  collects chart drawing information (&lt;code&gt;null&lt;/code&gt;<a name="line.3198"></a>
<span class="sourceLineNo">3199</span>     *              permitted).<a name="line.3199"></a>
<span class="sourceLineNo">3200</span>     */<a name="line.3200"></a>
<span class="sourceLineNo">3201</span>    public void draw(Graphics2D g2, Rectangle2D area, Point2D anchor,<a name="line.3201"></a>
<span class="sourceLineNo">3202</span>            PlotState parentState, PlotRenderingInfo info) {<a name="line.3202"></a>
<span class="sourceLineNo">3203</span><a name="line.3203"></a>
<span class="sourceLineNo">3204</span>        // if the plot area is too small, just return...<a name="line.3204"></a>
<span class="sourceLineNo">3205</span>        boolean b1 = (area.getWidth() &lt;= MINIMUM_WIDTH_TO_DRAW);<a name="line.3205"></a>
<span class="sourceLineNo">3206</span>        boolean b2 = (area.getHeight() &lt;= MINIMUM_HEIGHT_TO_DRAW);<a name="line.3206"></a>
<span class="sourceLineNo">3207</span>        if (b1 || b2) {<a name="line.3207"></a>
<span class="sourceLineNo">3208</span>            return;<a name="line.3208"></a>
<span class="sourceLineNo">3209</span>        }<a name="line.3209"></a>
<span class="sourceLineNo">3210</span><a name="line.3210"></a>
<span class="sourceLineNo">3211</span>        // record the plot area...<a name="line.3211"></a>
<span class="sourceLineNo">3212</span>        if (info != null) {<a name="line.3212"></a>
<span class="sourceLineNo">3213</span>            info.setPlotArea(area);<a name="line.3213"></a>
<span class="sourceLineNo">3214</span>        }<a name="line.3214"></a>
<span class="sourceLineNo">3215</span><a name="line.3215"></a>
<span class="sourceLineNo">3216</span>        // adjust the drawing area for the plot insets (if any)...<a name="line.3216"></a>
<span class="sourceLineNo">3217</span>        RectangleInsets insets = getInsets();<a name="line.3217"></a>
<span class="sourceLineNo">3218</span>        insets.trim(area);<a name="line.3218"></a>
<span class="sourceLineNo">3219</span><a name="line.3219"></a>
<span class="sourceLineNo">3220</span>        AxisSpace space = calculateAxisSpace(g2, area);<a name="line.3220"></a>
<span class="sourceLineNo">3221</span>        Rectangle2D dataArea = space.shrink(area, null);<a name="line.3221"></a>
<span class="sourceLineNo">3222</span>        this.axisOffset.trim(dataArea);<a name="line.3222"></a>
<span class="sourceLineNo">3223</span><a name="line.3223"></a>
<span class="sourceLineNo">3224</span>        dataArea = integerise(dataArea);<a name="line.3224"></a>
<span class="sourceLineNo">3225</span>        if (dataArea.isEmpty()) {<a name="line.3225"></a>
<span class="sourceLineNo">3226</span>            return;<a name="line.3226"></a>
<span class="sourceLineNo">3227</span>        }<a name="line.3227"></a>
<span class="sourceLineNo">3228</span>        createAndAddEntity((Rectangle2D) dataArea.clone(), info, null, null);<a name="line.3228"></a>
<span class="sourceLineNo">3229</span>        if (info != null) {<a name="line.3229"></a>
<span class="sourceLineNo">3230</span>            info.setDataArea(dataArea);<a name="line.3230"></a>
<span class="sourceLineNo">3231</span>        }<a name="line.3231"></a>
<span class="sourceLineNo">3232</span><a name="line.3232"></a>
<span class="sourceLineNo">3233</span>        // draw the plot background and axes...<a name="line.3233"></a>
<span class="sourceLineNo">3234</span>        drawBackground(g2, dataArea);<a name="line.3234"></a>
<span class="sourceLineNo">3235</span>        Map axisStateMap = drawAxes(g2, area, dataArea, info);<a name="line.3235"></a>
<span class="sourceLineNo">3236</span><a name="line.3236"></a>
<span class="sourceLineNo">3237</span>        PlotOrientation orient = getOrientation();<a name="line.3237"></a>
<span class="sourceLineNo">3238</span><a name="line.3238"></a>
<span class="sourceLineNo">3239</span>        // the anchor point is typically the point where the mouse last<a name="line.3239"></a>
<span class="sourceLineNo">3240</span>        // clicked - the crosshairs will be driven off this point...<a name="line.3240"></a>
<span class="sourceLineNo">3241</span>        if (anchor != null &amp;&amp; !dataArea.contains(anchor)) {<a name="line.3241"></a>
<span class="sourceLineNo">3242</span>            anchor = null;<a name="line.3242"></a>
<span class="sourceLineNo">3243</span>        }<a name="line.3243"></a>
<span class="sourceLineNo">3244</span>        CrosshairState crosshairState = new CrosshairState();<a name="line.3244"></a>
<span class="sourceLineNo">3245</span>        crosshairState.setCrosshairDistance(Double.POSITIVE_INFINITY);<a name="line.3245"></a>
<span class="sourceLineNo">3246</span>        crosshairState.setAnchor(anchor);<a name="line.3246"></a>
<span class="sourceLineNo">3247</span><a name="line.3247"></a>
<span class="sourceLineNo">3248</span>        crosshairState.setAnchorX(Double.NaN);<a name="line.3248"></a>
<span class="sourceLineNo">3249</span>        crosshairState.setAnchorY(Double.NaN);<a name="line.3249"></a>
<span class="sourceLineNo">3250</span>        if (anchor != null) {<a name="line.3250"></a>
<span class="sourceLineNo">3251</span>            ValueAxis domainAxis = getDomainAxis();<a name="line.3251"></a>
<span class="sourceLineNo">3252</span>            if (domainAxis != null) {<a name="line.3252"></a>
<span class="sourceLineNo">3253</span>                double x;<a name="line.3253"></a>
<span class="sourceLineNo">3254</span>                if (orient == PlotOrientation.VERTICAL) {<a name="line.3254"></a>
<span class="sourceLineNo">3255</span>                    x = domainAxis.java2DToValue(anchor.getX(), dataArea,<a name="line.3255"></a>
<span class="sourceLineNo">3256</span>                            getDomainAxisEdge());<a name="line.3256"></a>
<span class="sourceLineNo">3257</span>                }<a name="line.3257"></a>
<span class="sourceLineNo">3258</span>                else {<a name="line.3258"></a>
<span class="sourceLineNo">3259</span>                    x = domainAxis.java2DToValue(anchor.getY(), dataArea,<a name="line.3259"></a>
<span class="sourceLineNo">3260</span>                            getDomainAxisEdge());<a name="line.3260"></a>
<span class="sourceLineNo">3261</span>                }<a name="line.3261"></a>
<span class="sourceLineNo">3262</span>                crosshairState.setAnchorX(x);<a name="line.3262"></a>
<span class="sourceLineNo">3263</span>            }<a name="line.3263"></a>
<span class="sourceLineNo">3264</span>            ValueAxis rangeAxis = getRangeAxis();<a name="line.3264"></a>
<span class="sourceLineNo">3265</span>            if (rangeAxis != null) {<a name="line.3265"></a>
<span class="sourceLineNo">3266</span>                double y;<a name="line.3266"></a>
<span class="sourceLineNo">3267</span>                if (orient == PlotOrientation.VERTICAL) {<a name="line.3267"></a>
<span class="sourceLineNo">3268</span>                    y = rangeAxis.java2DToValue(anchor.getY(), dataArea,<a name="line.3268"></a>
<span class="sourceLineNo">3269</span>                            getRangeAxisEdge());<a name="line.3269"></a>
<span class="sourceLineNo">3270</span>                }<a name="line.3270"></a>
<span class="sourceLineNo">3271</span>                else {<a name="line.3271"></a>
<span class="sourceLineNo">3272</span>                    y = rangeAxis.java2DToValue(anchor.getX(), dataArea,<a name="line.3272"></a>
<span class="sourceLineNo">3273</span>                            getRangeAxisEdge());<a name="line.3273"></a>
<span class="sourceLineNo">3274</span>                }<a name="line.3274"></a>
<span class="sourceLineNo">3275</span>                crosshairState.setAnchorY(y);<a name="line.3275"></a>
<span class="sourceLineNo">3276</span>            }<a name="line.3276"></a>
<span class="sourceLineNo">3277</span>        }<a name="line.3277"></a>
<span class="sourceLineNo">3278</span>        crosshairState.setCrosshairX(getDomainCrosshairValue());<a name="line.3278"></a>
<span class="sourceLineNo">3279</span>        crosshairState.setCrosshairY(getRangeCrosshairValue());<a name="line.3279"></a>
<span class="sourceLineNo">3280</span>        Shape originalClip = g2.getClip();<a name="line.3280"></a>
<span class="sourceLineNo">3281</span>        Composite originalComposite = g2.getComposite();<a name="line.3281"></a>
<span class="sourceLineNo">3282</span><a name="line.3282"></a>
<span class="sourceLineNo">3283</span>        g2.clip(dataArea);<a name="line.3283"></a>
<span class="sourceLineNo">3284</span>        g2.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER,<a name="line.3284"></a>
<span class="sourceLineNo">3285</span>                getForegroundAlpha()));<a name="line.3285"></a>
<span class="sourceLineNo">3286</span><a name="line.3286"></a>
<span class="sourceLineNo">3287</span>        AxisState domainAxisState = (AxisState) axisStateMap.get(<a name="line.3287"></a>
<span class="sourceLineNo">3288</span>                getDomainAxis());<a name="line.3288"></a>
<span class="sourceLineNo">3289</span>        if (domainAxisState == null) {<a name="line.3289"></a>
<span class="sourceLineNo">3290</span>            if (parentState != null) {<a name="line.3290"></a>
<span class="sourceLineNo">3291</span>                domainAxisState = (AxisState) parentState.getSharedAxisStates()<a name="line.3291"></a>
<span class="sourceLineNo">3292</span>                        .get(getDomainAxis());<a name="line.3292"></a>
<span class="sourceLineNo">3293</span>            }<a name="line.3293"></a>
<span class="sourceLineNo">3294</span>        }<a name="line.3294"></a>
<span class="sourceLineNo">3295</span><a name="line.3295"></a>
<span class="sourceLineNo">3296</span>        AxisState rangeAxisState = (AxisState) axisStateMap.get(getRangeAxis());<a name="line.3296"></a>
<span class="sourceLineNo">3297</span>        if (rangeAxisState == null) {<a name="line.3297"></a>
<span class="sourceLineNo">3298</span>            if (parentState != null) {<a name="line.3298"></a>
<span class="sourceLineNo">3299</span>                rangeAxisState = (AxisState) parentState.getSharedAxisStates()<a name="line.3299"></a>
<span class="sourceLineNo">3300</span>                        .get(getRangeAxis());<a name="line.3300"></a>
<span class="sourceLineNo">3301</span>            }<a name="line.3301"></a>
<span class="sourceLineNo">3302</span>        }<a name="line.3302"></a>
<span class="sourceLineNo">3303</span>        if (domainAxisState != null) {<a name="line.3303"></a>
<span class="sourceLineNo">3304</span>            drawDomainTickBands(g2, dataArea, domainAxisState.getTicks());<a name="line.3304"></a>
<span class="sourceLineNo">3305</span>        }<a name="line.3305"></a>
<span class="sourceLineNo">3306</span>        if (rangeAxisState != null) {<a name="line.3306"></a>
<span class="sourceLineNo">3307</span>            drawRangeTickBands(g2, dataArea, rangeAxisState.getTicks());<a name="line.3307"></a>
<span class="sourceLineNo">3308</span>        }<a name="line.3308"></a>
<span class="sourceLineNo">3309</span>        if (domainAxisState != null) {<a name="line.3309"></a>
<span class="sourceLineNo">3310</span>            drawDomainGridlines(g2, dataArea, domainAxisState.getTicks());<a name="line.3310"></a>
<span class="sourceLineNo">3311</span>            drawZeroDomainBaseline(g2, dataArea);<a name="line.3311"></a>
<span class="sourceLineNo">3312</span>        }<a name="line.3312"></a>
<span class="sourceLineNo">3313</span>        if (rangeAxisState != null) {<a name="line.3313"></a>
<span class="sourceLineNo">3314</span>            drawRangeGridlines(g2, dataArea, rangeAxisState.getTicks());<a name="line.3314"></a>
<span class="sourceLineNo">3315</span>            drawZeroRangeBaseline(g2, dataArea);<a name="line.3315"></a>
<span class="sourceLineNo">3316</span>        }<a name="line.3316"></a>
<span class="sourceLineNo">3317</span><a name="line.3317"></a>
<span class="sourceLineNo">3318</span>        Graphics2D savedG2 = g2;<a name="line.3318"></a>
<span class="sourceLineNo">3319</span>        BufferedImage dataImage = null;<a name="line.3319"></a>
<span class="sourceLineNo">3320</span>        if (this.shadowGenerator != null) {<a name="line.3320"></a>
<span class="sourceLineNo">3321</span>            dataImage = new BufferedImage((int) dataArea.getWidth(),<a name="line.3321"></a>
<span class="sourceLineNo">3322</span>                    (int)dataArea.getHeight(), BufferedImage.TYPE_INT_ARGB);<a name="line.3322"></a>
<span class="sourceLineNo">3323</span>            g2 = dataImage.createGraphics();<a name="line.3323"></a>
<span class="sourceLineNo">3324</span>            g2.translate(-dataArea.getX(), -dataArea.getY());<a name="line.3324"></a>
<span class="sourceLineNo">3325</span>            g2.setRenderingHints(savedG2.getRenderingHints());<a name="line.3325"></a>
<span class="sourceLineNo">3326</span>        }<a name="line.3326"></a>
<span class="sourceLineNo">3327</span><a name="line.3327"></a>
<span class="sourceLineNo">3328</span>        // draw the markers that are associated with a specific renderer...<a name="line.3328"></a>
<span class="sourceLineNo">3329</span>        for (int i = 0; i &lt; this.renderers.size(); i++) {<a name="line.3329"></a>
<span class="sourceLineNo">3330</span>            drawDomainMarkers(g2, dataArea, i, Layer.BACKGROUND);<a name="line.3330"></a>
<span class="sourceLineNo">3331</span>        }<a name="line.3331"></a>
<span class="sourceLineNo">3332</span>        for (int i = 0; i &lt; this.renderers.size(); i++) {<a name="line.3332"></a>
<span class="sourceLineNo">3333</span>            drawRangeMarkers(g2, dataArea, i, Layer.BACKGROUND);<a name="line.3333"></a>
<span class="sourceLineNo">3334</span>        }<a name="line.3334"></a>
<span class="sourceLineNo">3335</span><a name="line.3335"></a>
<span class="sourceLineNo">3336</span>        // now draw annotations and render data items...<a name="line.3336"></a>
<span class="sourceLineNo">3337</span>        boolean foundData = false;<a name="line.3337"></a>
<span class="sourceLineNo">3338</span>        DatasetRenderingOrder order = getDatasetRenderingOrder();<a name="line.3338"></a>
<span class="sourceLineNo">3339</span>        if (order == DatasetRenderingOrder.FORWARD) {<a name="line.3339"></a>
<span class="sourceLineNo">3340</span><a name="line.3340"></a>
<span class="sourceLineNo">3341</span>            // draw background annotations<a name="line.3341"></a>
<span class="sourceLineNo">3342</span>            int rendererCount = this.renderers.size();<a name="line.3342"></a>
<span class="sourceLineNo">3343</span>            for (int i = 0; i &lt; rendererCount; i++) {<a name="line.3343"></a>
<span class="sourceLineNo">3344</span>                XYItemRenderer r = getRenderer(i);<a name="line.3344"></a>
<span class="sourceLineNo">3345</span>                if (r != null) {<a name="line.3345"></a>
<span class="sourceLineNo">3346</span>                    ValueAxis domainAxis = getDomainAxisForDataset(i);<a name="line.3346"></a>
<span class="sourceLineNo">3347</span>                    ValueAxis rangeAxis = getRangeAxisForDataset(i);<a name="line.3347"></a>
<span class="sourceLineNo">3348</span>                    r.drawAnnotations(g2, dataArea, domainAxis, rangeAxis,<a name="line.3348"></a>
<span class="sourceLineNo">3349</span>                            Layer.BACKGROUND, info);<a name="line.3349"></a>
<span class="sourceLineNo">3350</span>                }<a name="line.3350"></a>
<span class="sourceLineNo">3351</span>            }<a name="line.3351"></a>
<span class="sourceLineNo">3352</span><a name="line.3352"></a>
<span class="sourceLineNo">3353</span>            // render data items...<a name="line.3353"></a>
<span class="sourceLineNo">3354</span>            for (int i = 0; i &lt; getDatasetCount(); i++) {<a name="line.3354"></a>
<span class="sourceLineNo">3355</span>                foundData = render(g2, dataArea, i, info, crosshairState)<a name="line.3355"></a>
<span class="sourceLineNo">3356</span>                    || foundData;<a name="line.3356"></a>
<span class="sourceLineNo">3357</span>            }<a name="line.3357"></a>
<span class="sourceLineNo">3358</span><a name="line.3358"></a>
<span class="sourceLineNo">3359</span>            // draw foreground annotations<a name="line.3359"></a>
<span class="sourceLineNo">3360</span>            for (int i = 0; i &lt; rendererCount; i++) {<a name="line.3360"></a>
<span class="sourceLineNo">3361</span>                XYItemRenderer r = getRenderer(i);<a name="line.3361"></a>
<span class="sourceLineNo">3362</span>                if (r != null) {<a name="line.3362"></a>
<span class="sourceLineNo">3363</span>                    ValueAxis domainAxis = getDomainAxisForDataset(i);<a name="line.3363"></a>
<span class="sourceLineNo">3364</span>                    ValueAxis rangeAxis = getRangeAxisForDataset(i);<a name="line.3364"></a>
<span class="sourceLineNo">3365</span>                    r.drawAnnotations(g2, dataArea, domainAxis, rangeAxis,<a name="line.3365"></a>
<span class="sourceLineNo">3366</span>                            Layer.FOREGROUND, info);<a name="line.3366"></a>
<span class="sourceLineNo">3367</span>                }<a name="line.3367"></a>
<span class="sourceLineNo">3368</span>            }<a name="line.3368"></a>
<span class="sourceLineNo">3369</span><a name="line.3369"></a>
<span class="sourceLineNo">3370</span>        }<a name="line.3370"></a>
<span class="sourceLineNo">3371</span>        else if (order == DatasetRenderingOrder.REVERSE) {<a name="line.3371"></a>
<span class="sourceLineNo">3372</span><a name="line.3372"></a>
<span class="sourceLineNo">3373</span>            // draw background annotations<a name="line.3373"></a>
<span class="sourceLineNo">3374</span>            int rendererCount = this.renderers.size();<a name="line.3374"></a>
<span class="sourceLineNo">3375</span>            for (int i = rendererCount - 1; i &gt;= 0; i--) {<a name="line.3375"></a>
<span class="sourceLineNo">3376</span>                XYItemRenderer r = getRenderer(i);<a name="line.3376"></a>
<span class="sourceLineNo">3377</span>                if (i &gt;= getDatasetCount()) { // we need the dataset to make<a name="line.3377"></a>
<span class="sourceLineNo">3378</span>                    continue;                 // a link to the axes<a name="line.3378"></a>
<span class="sourceLineNo">3379</span>                }<a name="line.3379"></a>
<span class="sourceLineNo">3380</span>                if (r != null) {<a name="line.3380"></a>
<span class="sourceLineNo">3381</span>                    ValueAxis domainAxis = getDomainAxisForDataset(i);<a name="line.3381"></a>
<span class="sourceLineNo">3382</span>                    ValueAxis rangeAxis = getRangeAxisForDataset(i);<a name="line.3382"></a>
<span class="sourceLineNo">3383</span>                    r.drawAnnotations(g2, dataArea, domainAxis, rangeAxis,<a name="line.3383"></a>
<span class="sourceLineNo">3384</span>                            Layer.BACKGROUND, info);<a name="line.3384"></a>
<span class="sourceLineNo">3385</span>                }<a name="line.3385"></a>
<span class="sourceLineNo">3386</span>            }<a name="line.3386"></a>
<span class="sourceLineNo">3387</span><a name="line.3387"></a>
<span class="sourceLineNo">3388</span>            for (int i = getDatasetCount() - 1; i &gt;= 0; i--) {<a name="line.3388"></a>
<span class="sourceLineNo">3389</span>                foundData = render(g2, dataArea, i, info, crosshairState)<a name="line.3389"></a>
<span class="sourceLineNo">3390</span>                    || foundData;<a name="line.3390"></a>
<span class="sourceLineNo">3391</span>            }<a name="line.3391"></a>
<span class="sourceLineNo">3392</span><a name="line.3392"></a>
<span class="sourceLineNo">3393</span>            // draw foreground annotations<a name="line.3393"></a>
<span class="sourceLineNo">3394</span>            for (int i = rendererCount - 1; i &gt;= 0; i--) {<a name="line.3394"></a>
<span class="sourceLineNo">3395</span>                XYItemRenderer r = getRenderer(i);<a name="line.3395"></a>
<span class="sourceLineNo">3396</span>                if (i &gt;= getDatasetCount()) { // we need the dataset to make<a name="line.3396"></a>
<span class="sourceLineNo">3397</span>                    continue;                 // a link to the axes<a name="line.3397"></a>
<span class="sourceLineNo">3398</span>                }<a name="line.3398"></a>
<span class="sourceLineNo">3399</span>                if (r != null) {<a name="line.3399"></a>
<span class="sourceLineNo">3400</span>                    ValueAxis domainAxis = getDomainAxisForDataset(i);<a name="line.3400"></a>
<span class="sourceLineNo">3401</span>                    ValueAxis rangeAxis = getRangeAxisForDataset(i);<a name="line.3401"></a>
<span class="sourceLineNo">3402</span>                    r.drawAnnotations(g2, dataArea, domainAxis, rangeAxis,<a name="line.3402"></a>
<span class="sourceLineNo">3403</span>                            Layer.FOREGROUND, info);<a name="line.3403"></a>
<span class="sourceLineNo">3404</span>                }<a name="line.3404"></a>
<span class="sourceLineNo">3405</span>            }<a name="line.3405"></a>
<span class="sourceLineNo">3406</span><a name="line.3406"></a>
<span class="sourceLineNo">3407</span>        }<a name="line.3407"></a>
<span class="sourceLineNo">3408</span><a name="line.3408"></a>
<span class="sourceLineNo">3409</span>        // draw domain crosshair if required...<a name="line.3409"></a>
<span class="sourceLineNo">3410</span>        int xAxisIndex = crosshairState.getDomainAxisIndex();<a name="line.3410"></a>
<span class="sourceLineNo">3411</span>        ValueAxis xAxis = getDomainAxis(xAxisIndex);<a name="line.3411"></a>
<span class="sourceLineNo">3412</span>        RectangleEdge xAxisEdge = getDomainAxisEdge(xAxisIndex);<a name="line.3412"></a>
<span class="sourceLineNo">3413</span>        if (!this.domainCrosshairLockedOnData &amp;&amp; anchor != null) {<a name="line.3413"></a>
<span class="sourceLineNo">3414</span>            double xx;<a name="line.3414"></a>
<span class="sourceLineNo">3415</span>            if (orient == PlotOrientation.VERTICAL) {<a name="line.3415"></a>
<span class="sourceLineNo">3416</span>                xx = xAxis.java2DToValue(anchor.getX(), dataArea, xAxisEdge);<a name="line.3416"></a>
<span class="sourceLineNo">3417</span>            }<a name="line.3417"></a>
<span class="sourceLineNo">3418</span>            else {<a name="line.3418"></a>
<span class="sourceLineNo">3419</span>                xx = xAxis.java2DToValue(anchor.getY(), dataArea, xAxisEdge);<a name="line.3419"></a>
<span class="sourceLineNo">3420</span>            }<a name="line.3420"></a>
<span class="sourceLineNo">3421</span>            crosshairState.setCrosshairX(xx);<a name="line.3421"></a>
<span class="sourceLineNo">3422</span>        }<a name="line.3422"></a>
<span class="sourceLineNo">3423</span>        setDomainCrosshairValue(crosshairState.getCrosshairX(), false);<a name="line.3423"></a>
<span class="sourceLineNo">3424</span>        if (isDomainCrosshairVisible()) {<a name="line.3424"></a>
<span class="sourceLineNo">3425</span>            double x = getDomainCrosshairValue();<a name="line.3425"></a>
<span class="sourceLineNo">3426</span>            Paint paint = getDomainCrosshairPaint();<a name="line.3426"></a>
<span class="sourceLineNo">3427</span>            Stroke stroke = getDomainCrosshairStroke();<a name="line.3427"></a>
<span class="sourceLineNo">3428</span>            drawDomainCrosshair(g2, dataArea, orient, x, xAxis, stroke, paint);<a name="line.3428"></a>
<span class="sourceLineNo">3429</span>        }<a name="line.3429"></a>
<span class="sourceLineNo">3430</span><a name="line.3430"></a>
<span class="sourceLineNo">3431</span>        // draw range crosshair if required...<a name="line.3431"></a>
<span class="sourceLineNo">3432</span>        int yAxisIndex = crosshairState.getRangeAxisIndex();<a name="line.3432"></a>
<span class="sourceLineNo">3433</span>        ValueAxis yAxis = getRangeAxis(yAxisIndex);<a name="line.3433"></a>
<span class="sourceLineNo">3434</span>        RectangleEdge yAxisEdge = getRangeAxisEdge(yAxisIndex);<a name="line.3434"></a>
<span class="sourceLineNo">3435</span>        if (!this.rangeCrosshairLockedOnData &amp;&amp; anchor != null) {<a name="line.3435"></a>
<span class="sourceLineNo">3436</span>            double yy;<a name="line.3436"></a>
<span class="sourceLineNo">3437</span>            if (orient == PlotOrientation.VERTICAL) {<a name="line.3437"></a>
<span class="sourceLineNo">3438</span>                yy = yAxis.java2DToValue(anchor.getY(), dataArea, yAxisEdge);<a name="line.3438"></a>
<span class="sourceLineNo">3439</span>            } else {<a name="line.3439"></a>
<span class="sourceLineNo">3440</span>                yy = yAxis.java2DToValue(anchor.getX(), dataArea, yAxisEdge);<a name="line.3440"></a>
<span class="sourceLineNo">3441</span>            }<a name="line.3441"></a>
<span class="sourceLineNo">3442</span>            crosshairState.setCrosshairY(yy);<a name="line.3442"></a>
<span class="sourceLineNo">3443</span>        }<a name="line.3443"></a>
<span class="sourceLineNo">3444</span>        setRangeCrosshairValue(crosshairState.getCrosshairY(), false);<a name="line.3444"></a>
<span class="sourceLineNo">3445</span>        if (isRangeCrosshairVisible()) {<a name="line.3445"></a>
<span class="sourceLineNo">3446</span>            double y = getRangeCrosshairValue();<a name="line.3446"></a>
<span class="sourceLineNo">3447</span>            Paint paint = getRangeCrosshairPaint();<a name="line.3447"></a>
<span class="sourceLineNo">3448</span>            Stroke stroke = getRangeCrosshairStroke();<a name="line.3448"></a>
<span class="sourceLineNo">3449</span>            drawRangeCrosshair(g2, dataArea, orient, y, yAxis, stroke, paint);<a name="line.3449"></a>
<span class="sourceLineNo">3450</span>        }<a name="line.3450"></a>
<span class="sourceLineNo">3451</span><a name="line.3451"></a>
<span class="sourceLineNo">3452</span>        if (!foundData) {<a name="line.3452"></a>
<span class="sourceLineNo">3453</span>            drawNoDataMessage(g2, dataArea);<a name="line.3453"></a>
<span class="sourceLineNo">3454</span>        }<a name="line.3454"></a>
<span class="sourceLineNo">3455</span><a name="line.3455"></a>
<span class="sourceLineNo">3456</span>        for (int i = 0; i &lt; this.renderers.size(); i++) {<a name="line.3456"></a>
<span class="sourceLineNo">3457</span>            drawDomainMarkers(g2, dataArea, i, Layer.FOREGROUND);<a name="line.3457"></a>
<span class="sourceLineNo">3458</span>        }<a name="line.3458"></a>
<span class="sourceLineNo">3459</span>        for (int i = 0; i &lt; this.renderers.size(); i++) {<a name="line.3459"></a>
<span class="sourceLineNo">3460</span>            drawRangeMarkers(g2, dataArea, i, Layer.FOREGROUND);<a name="line.3460"></a>
<span class="sourceLineNo">3461</span>        }<a name="line.3461"></a>
<span class="sourceLineNo">3462</span><a name="line.3462"></a>
<span class="sourceLineNo">3463</span>        drawAnnotations(g2, dataArea, info);<a name="line.3463"></a>
<span class="sourceLineNo">3464</span>        if (this.shadowGenerator != null) {<a name="line.3464"></a>
<span class="sourceLineNo">3465</span>            BufferedImage shadowImage<a name="line.3465"></a>
<span class="sourceLineNo">3466</span>                    = this.shadowGenerator.createDropShadow(dataImage);<a name="line.3466"></a>
<span class="sourceLineNo">3467</span>            g2 = savedG2;<a name="line.3467"></a>
<span class="sourceLineNo">3468</span>            g2.drawImage(shadowImage, (int) dataArea.getX() <a name="line.3468"></a>
<span class="sourceLineNo">3469</span>                    + this.shadowGenerator.calculateOffsetX(),<a name="line.3469"></a>
<span class="sourceLineNo">3470</span>                    (int) dataArea.getY() <a name="line.3470"></a>
<span class="sourceLineNo">3471</span>                    + this.shadowGenerator.calculateOffsetY(), null);<a name="line.3471"></a>
<span class="sourceLineNo">3472</span>            g2.drawImage(dataImage, (int) dataArea.getX(),<a name="line.3472"></a>
<span class="sourceLineNo">3473</span>                    (int) dataArea.getY(), null);<a name="line.3473"></a>
<span class="sourceLineNo">3474</span>        }<a name="line.3474"></a>
<span class="sourceLineNo">3475</span>        g2.setClip(originalClip);<a name="line.3475"></a>
<span class="sourceLineNo">3476</span>        g2.setComposite(originalComposite);<a name="line.3476"></a>
<span class="sourceLineNo">3477</span><a name="line.3477"></a>
<span class="sourceLineNo">3478</span>        drawOutline(g2, dataArea);<a name="line.3478"></a>
<span class="sourceLineNo">3479</span><a name="line.3479"></a>
<span class="sourceLineNo">3480</span>    }<a name="line.3480"></a>
<span class="sourceLineNo">3481</span><a name="line.3481"></a>
<span class="sourceLineNo">3482</span>    /**<a name="line.3482"></a>
<span class="sourceLineNo">3483</span>     * Draws the background for the plot.<a name="line.3483"></a>
<span class="sourceLineNo">3484</span>     *<a name="line.3484"></a>
<span class="sourceLineNo">3485</span>     * @param g2  the graphics device.<a name="line.3485"></a>
<span class="sourceLineNo">3486</span>     * @param area  the area.<a name="line.3486"></a>
<span class="sourceLineNo">3487</span>     */<a name="line.3487"></a>
<span class="sourceLineNo">3488</span>    public void drawBackground(Graphics2D g2, Rectangle2D area) {<a name="line.3488"></a>
<span class="sourceLineNo">3489</span>        fillBackground(g2, area, this.orientation);<a name="line.3489"></a>
<span class="sourceLineNo">3490</span>        drawQuadrants(g2, area);<a name="line.3490"></a>
<span class="sourceLineNo">3491</span>        drawBackgroundImage(g2, area);<a name="line.3491"></a>
<span class="sourceLineNo">3492</span>    }<a name="line.3492"></a>
<span class="sourceLineNo">3493</span><a name="line.3493"></a>
<span class="sourceLineNo">3494</span>    /**<a name="line.3494"></a>
<span class="sourceLineNo">3495</span>     * Draws the quadrants.<a name="line.3495"></a>
<span class="sourceLineNo">3496</span>     *<a name="line.3496"></a>
<span class="sourceLineNo">3497</span>     * @param g2  the graphics device.<a name="line.3497"></a>
<span class="sourceLineNo">3498</span>     * @param area  the area.<a name="line.3498"></a>
<span class="sourceLineNo">3499</span>     *<a name="line.3499"></a>
<span class="sourceLineNo">3500</span>     * @see #setQuadrantOrigin(Point2D)<a name="line.3500"></a>
<span class="sourceLineNo">3501</span>     * @see #setQuadrantPaint(int, Paint)<a name="line.3501"></a>
<span class="sourceLineNo">3502</span>     */<a name="line.3502"></a>
<span class="sourceLineNo">3503</span>    protected void drawQuadrants(Graphics2D g2, Rectangle2D area) {<a name="line.3503"></a>
<span class="sourceLineNo">3504</span>        //  0 | 1<a name="line.3504"></a>
<span class="sourceLineNo">3505</span>        //  --+--<a name="line.3505"></a>
<span class="sourceLineNo">3506</span>        //  2 | 3<a name="line.3506"></a>
<span class="sourceLineNo">3507</span>        boolean somethingToDraw = false;<a name="line.3507"></a>
<span class="sourceLineNo">3508</span><a name="line.3508"></a>
<span class="sourceLineNo">3509</span>        ValueAxis xAxis = getDomainAxis();<a name="line.3509"></a>
<span class="sourceLineNo">3510</span>        if (xAxis == null) {  // we can't draw quadrants without a valid x-axis<a name="line.3510"></a>
<span class="sourceLineNo">3511</span>            return;<a name="line.3511"></a>
<span class="sourceLineNo">3512</span>        }<a name="line.3512"></a>
<span class="sourceLineNo">3513</span>        double x = xAxis.getRange().constrain(this.quadrantOrigin.getX());<a name="line.3513"></a>
<span class="sourceLineNo">3514</span>        double xx = xAxis.valueToJava2D(x, area, getDomainAxisEdge());<a name="line.3514"></a>
<span class="sourceLineNo">3515</span><a name="line.3515"></a>
<span class="sourceLineNo">3516</span>        ValueAxis yAxis = getRangeAxis();<a name="line.3516"></a>
<span class="sourceLineNo">3517</span>        if (yAxis == null) {  // we can't draw quadrants without a valid y-axis<a name="line.3517"></a>
<span class="sourceLineNo">3518</span>            return;<a name="line.3518"></a>
<span class="sourceLineNo">3519</span>        }<a name="line.3519"></a>
<span class="sourceLineNo">3520</span>        double y = yAxis.getRange().constrain(this.quadrantOrigin.getY());<a name="line.3520"></a>
<span class="sourceLineNo">3521</span>        double yy = yAxis.valueToJava2D(y, area, getRangeAxisEdge());<a name="line.3521"></a>
<span class="sourceLineNo">3522</span><a name="line.3522"></a>
<span class="sourceLineNo">3523</span>        double xmin = xAxis.getLowerBound();<a name="line.3523"></a>
<span class="sourceLineNo">3524</span>        double xxmin = xAxis.valueToJava2D(xmin, area, getDomainAxisEdge());<a name="line.3524"></a>
<span class="sourceLineNo">3525</span><a name="line.3525"></a>
<span class="sourceLineNo">3526</span>        double xmax = xAxis.getUpperBound();<a name="line.3526"></a>
<span class="sourceLineNo">3527</span>        double xxmax = xAxis.valueToJava2D(xmax, area, getDomainAxisEdge());<a name="line.3527"></a>
<span class="sourceLineNo">3528</span><a name="line.3528"></a>
<span class="sourceLineNo">3529</span>        double ymin = yAxis.getLowerBound();<a name="line.3529"></a>
<span class="sourceLineNo">3530</span>        double yymin = yAxis.valueToJava2D(ymin, area, getRangeAxisEdge());<a name="line.3530"></a>
<span class="sourceLineNo">3531</span><a name="line.3531"></a>
<span class="sourceLineNo">3532</span>        double ymax = yAxis.getUpperBound();<a name="line.3532"></a>
<span class="sourceLineNo">3533</span>        double yymax = yAxis.valueToJava2D(ymax, area, getRangeAxisEdge());<a name="line.3533"></a>
<span class="sourceLineNo">3534</span><a name="line.3534"></a>
<span class="sourceLineNo">3535</span>        Rectangle2D[] r = new Rectangle2D[] {null, null, null, null};<a name="line.3535"></a>
<span class="sourceLineNo">3536</span>        if (this.quadrantPaint[0] != null) {<a name="line.3536"></a>
<span class="sourceLineNo">3537</span>            if (x &gt; xmin &amp;&amp; y &lt; ymax) {<a name="line.3537"></a>
<span class="sourceLineNo">3538</span>                if (this.orientation == PlotOrientation.HORIZONTAL) {<a name="line.3538"></a>
<span class="sourceLineNo">3539</span>                    r[0] = new Rectangle2D.Double(Math.min(yymax, yy),<a name="line.3539"></a>
<span class="sourceLineNo">3540</span>                            Math.min(xxmin, xx), Math.abs(yy - yymax),<a name="line.3540"></a>
<span class="sourceLineNo">3541</span>                            Math.abs(xx - xxmin));<a name="line.3541"></a>
<span class="sourceLineNo">3542</span>                }<a name="line.3542"></a>
<span class="sourceLineNo">3543</span>                else {  // PlotOrientation.VERTICAL<a name="line.3543"></a>
<span class="sourceLineNo">3544</span>                    r[0] = new Rectangle2D.Double(Math.min(xxmin, xx),<a name="line.3544"></a>
<span class="sourceLineNo">3545</span>                            Math.min(yymax, yy), Math.abs(xx - xxmin),<a name="line.3545"></a>
<span class="sourceLineNo">3546</span>                            Math.abs(yy - yymax));<a name="line.3546"></a>
<span class="sourceLineNo">3547</span>                }<a name="line.3547"></a>
<span class="sourceLineNo">3548</span>                somethingToDraw = true;<a name="line.3548"></a>
<span class="sourceLineNo">3549</span>            }<a name="line.3549"></a>
<span class="sourceLineNo">3550</span>        }<a name="line.3550"></a>
<span class="sourceLineNo">3551</span>        if (this.quadrantPaint[1] != null) {<a name="line.3551"></a>
<span class="sourceLineNo">3552</span>            if (x &lt; xmax &amp;&amp; y &lt; ymax) {<a name="line.3552"></a>
<span class="sourceLineNo">3553</span>                if (this.orientation == PlotOrientation.HORIZONTAL) {<a name="line.3553"></a>
<span class="sourceLineNo">3554</span>                    r[1] = new Rectangle2D.Double(Math.min(yymax, yy),<a name="line.3554"></a>
<span class="sourceLineNo">3555</span>                            Math.min(xxmax, xx), Math.abs(yy - yymax),<a name="line.3555"></a>
<span class="sourceLineNo">3556</span>                            Math.abs(xx - xxmax));<a name="line.3556"></a>
<span class="sourceLineNo">3557</span>                }<a name="line.3557"></a>
<span class="sourceLineNo">3558</span>                else {  // PlotOrientation.VERTICAL<a name="line.3558"></a>
<span class="sourceLineNo">3559</span>                    r[1] = new Rectangle2D.Double(Math.min(xx, xxmax),<a name="line.3559"></a>
<span class="sourceLineNo">3560</span>                            Math.min(yymax, yy), Math.abs(xx - xxmax),<a name="line.3560"></a>
<span class="sourceLineNo">3561</span>                            Math.abs(yy - yymax));<a name="line.3561"></a>
<span class="sourceLineNo">3562</span>                }<a name="line.3562"></a>
<span class="sourceLineNo">3563</span>                somethingToDraw = true;<a name="line.3563"></a>
<span class="sourceLineNo">3564</span>            }<a name="line.3564"></a>
<span class="sourceLineNo">3565</span>        }<a name="line.3565"></a>
<span class="sourceLineNo">3566</span>        if (this.quadrantPaint[2] != null) {<a name="line.3566"></a>
<span class="sourceLineNo">3567</span>            if (x &gt; xmin &amp;&amp; y &gt; ymin) {<a name="line.3567"></a>
<span class="sourceLineNo">3568</span>                if (this.orientation == PlotOrientation.HORIZONTAL) {<a name="line.3568"></a>
<span class="sourceLineNo">3569</span>                    r[2] = new Rectangle2D.Double(Math.min(yymin, yy),<a name="line.3569"></a>
<span class="sourceLineNo">3570</span>                            Math.min(xxmin, xx), Math.abs(yy - yymin),<a name="line.3570"></a>
<span class="sourceLineNo">3571</span>                            Math.abs(xx - xxmin));<a name="line.3571"></a>
<span class="sourceLineNo">3572</span>                }<a name="line.3572"></a>
<span class="sourceLineNo">3573</span>                else {  // PlotOrientation.VERTICAL<a name="line.3573"></a>
<span class="sourceLineNo">3574</span>                    r[2] = new Rectangle2D.Double(Math.min(xxmin, xx),<a name="line.3574"></a>
<span class="sourceLineNo">3575</span>                            Math.min(yymin, yy), Math.abs(xx - xxmin),<a name="line.3575"></a>
<span class="sourceLineNo">3576</span>                            Math.abs(yy - yymin));<a name="line.3576"></a>
<span class="sourceLineNo">3577</span>                }<a name="line.3577"></a>
<span class="sourceLineNo">3578</span>                somethingToDraw = true;<a name="line.3578"></a>
<span class="sourceLineNo">3579</span>            }<a name="line.3579"></a>
<span class="sourceLineNo">3580</span>        }<a name="line.3580"></a>
<span class="sourceLineNo">3581</span>        if (this.quadrantPaint[3] != null) {<a name="line.3581"></a>
<span class="sourceLineNo">3582</span>            if (x &lt; xmax &amp;&amp; y &gt; ymin) {<a name="line.3582"></a>
<span class="sourceLineNo">3583</span>                if (this.orientation == PlotOrientation.HORIZONTAL) {<a name="line.3583"></a>
<span class="sourceLineNo">3584</span>                    r[3] = new Rectangle2D.Double(Math.min(yymin, yy),<a name="line.3584"></a>
<span class="sourceLineNo">3585</span>                            Math.min(xxmax, xx), Math.abs(yy - yymin),<a name="line.3585"></a>
<span class="sourceLineNo">3586</span>                            Math.abs(xx - xxmax));<a name="line.3586"></a>
<span class="sourceLineNo">3587</span>                }<a name="line.3587"></a>
<span class="sourceLineNo">3588</span>                else {  // PlotOrientation.VERTICAL<a name="line.3588"></a>
<span class="sourceLineNo">3589</span>                    r[3] = new Rectangle2D.Double(Math.min(xx, xxmax),<a name="line.3589"></a>
<span class="sourceLineNo">3590</span>                            Math.min(yymin, yy), Math.abs(xx - xxmax),<a name="line.3590"></a>
<span class="sourceLineNo">3591</span>                            Math.abs(yy - yymin));<a name="line.3591"></a>
<span class="sourceLineNo">3592</span>                }<a name="line.3592"></a>
<span class="sourceLineNo">3593</span>                somethingToDraw = true;<a name="line.3593"></a>
<span class="sourceLineNo">3594</span>            }<a name="line.3594"></a>
<span class="sourceLineNo">3595</span>        }<a name="line.3595"></a>
<span class="sourceLineNo">3596</span>        if (somethingToDraw) {<a name="line.3596"></a>
<span class="sourceLineNo">3597</span>            Composite originalComposite = g2.getComposite();<a name="line.3597"></a>
<span class="sourceLineNo">3598</span>            g2.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER,<a name="line.3598"></a>
<span class="sourceLineNo">3599</span>                    getBackgroundAlpha()));<a name="line.3599"></a>
<span class="sourceLineNo">3600</span>            for (int i = 0; i &lt; 4; i++) {<a name="line.3600"></a>
<span class="sourceLineNo">3601</span>                if (this.quadrantPaint[i] != null &amp;&amp; r[i] != null) {<a name="line.3601"></a>
<span class="sourceLineNo">3602</span>                    g2.setPaint(this.quadrantPaint[i]);<a name="line.3602"></a>
<span class="sourceLineNo">3603</span>                    g2.fill(r[i]);<a name="line.3603"></a>
<span class="sourceLineNo">3604</span>                }<a name="line.3604"></a>
<span class="sourceLineNo">3605</span>            }<a name="line.3605"></a>
<span class="sourceLineNo">3606</span>            g2.setComposite(originalComposite);<a name="line.3606"></a>
<span class="sourceLineNo">3607</span>        }<a name="line.3607"></a>
<span class="sourceLineNo">3608</span>    }<a name="line.3608"></a>
<span class="sourceLineNo">3609</span><a name="line.3609"></a>
<span class="sourceLineNo">3610</span>    /**<a name="line.3610"></a>
<span class="sourceLineNo">3611</span>     * Draws the domain tick bands, if any.<a name="line.3611"></a>
<span class="sourceLineNo">3612</span>     *<a name="line.3612"></a>
<span class="sourceLineNo">3613</span>     * @param g2  the graphics device.<a name="line.3613"></a>
<span class="sourceLineNo">3614</span>     * @param dataArea  the data area.<a name="line.3614"></a>
<span class="sourceLineNo">3615</span>     * @param ticks  the ticks.<a name="line.3615"></a>
<span class="sourceLineNo">3616</span>     *<a name="line.3616"></a>
<span class="sourceLineNo">3617</span>     * @see #setDomainTickBandPaint(Paint)<a name="line.3617"></a>
<span class="sourceLineNo">3618</span>     */<a name="line.3618"></a>
<span class="sourceLineNo">3619</span>    public void drawDomainTickBands(Graphics2D g2, Rectangle2D dataArea,<a name="line.3619"></a>
<span class="sourceLineNo">3620</span>                                    List ticks) {<a name="line.3620"></a>
<span class="sourceLineNo">3621</span>        Paint bandPaint = getDomainTickBandPaint();<a name="line.3621"></a>
<span class="sourceLineNo">3622</span>        if (bandPaint != null) {<a name="line.3622"></a>
<span class="sourceLineNo">3623</span>            boolean fillBand = false;<a name="line.3623"></a>
<span class="sourceLineNo">3624</span>            ValueAxis xAxis = getDomainAxis();<a name="line.3624"></a>
<span class="sourceLineNo">3625</span>            double previous = xAxis.getLowerBound();<a name="line.3625"></a>
<span class="sourceLineNo">3626</span>            Iterator iterator = ticks.iterator();<a name="line.3626"></a>
<span class="sourceLineNo">3627</span>            while (iterator.hasNext()) {<a name="line.3627"></a>
<span class="sourceLineNo">3628</span>                ValueTick tick = (ValueTick) iterator.next();<a name="line.3628"></a>
<span class="sourceLineNo">3629</span>                double current = tick.getValue();<a name="line.3629"></a>
<span class="sourceLineNo">3630</span>                if (fillBand) {<a name="line.3630"></a>
<span class="sourceLineNo">3631</span>                    getRenderer().fillDomainGridBand(g2, this, xAxis, dataArea,<a name="line.3631"></a>
<span class="sourceLineNo">3632</span>                            previous, current);<a name="line.3632"></a>
<span class="sourceLineNo">3633</span>                }<a name="line.3633"></a>
<span class="sourceLineNo">3634</span>                previous = current;<a name="line.3634"></a>
<span class="sourceLineNo">3635</span>                fillBand = !fillBand;<a name="line.3635"></a>
<span class="sourceLineNo">3636</span>            }<a name="line.3636"></a>
<span class="sourceLineNo">3637</span>            double end = xAxis.getUpperBound();<a name="line.3637"></a>
<span class="sourceLineNo">3638</span>            if (fillBand) {<a name="line.3638"></a>
<span class="sourceLineNo">3639</span>                getRenderer().fillDomainGridBand(g2, this, xAxis, dataArea,<a name="line.3639"></a>
<span class="sourceLineNo">3640</span>                        previous, end);<a name="line.3640"></a>
<span class="sourceLineNo">3641</span>            }<a name="line.3641"></a>
<span class="sourceLineNo">3642</span>        }<a name="line.3642"></a>
<span class="sourceLineNo">3643</span>    }<a name="line.3643"></a>
<span class="sourceLineNo">3644</span><a name="line.3644"></a>
<span class="sourceLineNo">3645</span>    /**<a name="line.3645"></a>
<span class="sourceLineNo">3646</span>     * Draws the range tick bands, if any.<a name="line.3646"></a>
<span class="sourceLineNo">3647</span>     *<a name="line.3647"></a>
<span class="sourceLineNo">3648</span>     * @param g2  the graphics device.<a name="line.3648"></a>
<span class="sourceLineNo">3649</span>     * @param dataArea  the data area.<a name="line.3649"></a>
<span class="sourceLineNo">3650</span>     * @param ticks  the ticks.<a name="line.3650"></a>
<span class="sourceLineNo">3651</span>     *<a name="line.3651"></a>
<span class="sourceLineNo">3652</span>     * @see #setRangeTickBandPaint(Paint)<a name="line.3652"></a>
<span class="sourceLineNo">3653</span>     */<a name="line.3653"></a>
<span class="sourceLineNo">3654</span>    public void drawRangeTickBands(Graphics2D g2, Rectangle2D dataArea,<a name="line.3654"></a>
<span class="sourceLineNo">3655</span>                                   List ticks) {<a name="line.3655"></a>
<span class="sourceLineNo">3656</span>        Paint bandPaint = getRangeTickBandPaint();<a name="line.3656"></a>
<span class="sourceLineNo">3657</span>        if (bandPaint != null) {<a name="line.3657"></a>
<span class="sourceLineNo">3658</span>            boolean fillBand = false;<a name="line.3658"></a>
<span class="sourceLineNo">3659</span>            ValueAxis axis = getRangeAxis();<a name="line.3659"></a>
<span class="sourceLineNo">3660</span>            double previous = axis.getLowerBound();<a name="line.3660"></a>
<span class="sourceLineNo">3661</span>            Iterator iterator = ticks.iterator();<a name="line.3661"></a>
<span class="sourceLineNo">3662</span>            while (iterator.hasNext()) {<a name="line.3662"></a>
<span class="sourceLineNo">3663</span>                ValueTick tick = (ValueTick) iterator.next();<a name="line.3663"></a>
<span class="sourceLineNo">3664</span>                double current = tick.getValue();<a name="line.3664"></a>
<span class="sourceLineNo">3665</span>                if (fillBand) {<a name="line.3665"></a>
<span class="sourceLineNo">3666</span>                    getRenderer().fillRangeGridBand(g2, this, axis, dataArea,<a name="line.3666"></a>
<span class="sourceLineNo">3667</span>                            previous, current);<a name="line.3667"></a>
<span class="sourceLineNo">3668</span>                }<a name="line.3668"></a>
<span class="sourceLineNo">3669</span>                previous = current;<a name="line.3669"></a>
<span class="sourceLineNo">3670</span>                fillBand = !fillBand;<a name="line.3670"></a>
<span class="sourceLineNo">3671</span>            }<a name="line.3671"></a>
<span class="sourceLineNo">3672</span>            double end = axis.getUpperBound();<a name="line.3672"></a>
<span class="sourceLineNo">3673</span>            if (fillBand) {<a name="line.3673"></a>
<span class="sourceLineNo">3674</span>                getRenderer().fillRangeGridBand(g2, this, axis, dataArea,<a name="line.3674"></a>
<span class="sourceLineNo">3675</span>                        previous, end);<a name="line.3675"></a>
<span class="sourceLineNo">3676</span>            }<a name="line.3676"></a>
<span class="sourceLineNo">3677</span>        }<a name="line.3677"></a>
<span class="sourceLineNo">3678</span>    }<a name="line.3678"></a>
<span class="sourceLineNo">3679</span><a name="line.3679"></a>
<span class="sourceLineNo">3680</span>    /**<a name="line.3680"></a>
<span class="sourceLineNo">3681</span>     * A utility method for drawing the axes.<a name="line.3681"></a>
<span class="sourceLineNo">3682</span>     *<a name="line.3682"></a>
<span class="sourceLineNo">3683</span>     * @param g2  the graphics device (&lt;code&gt;null&lt;/code&gt; not permitted).<a name="line.3683"></a>
<span class="sourceLineNo">3684</span>     * @param plotArea  the plot area (&lt;code&gt;null&lt;/code&gt; not permitted).<a name="line.3684"></a>
<span class="sourceLineNo">3685</span>     * @param dataArea  the data area (&lt;code&gt;null&lt;/code&gt; not permitted).<a name="line.3685"></a>
<span class="sourceLineNo">3686</span>     * @param plotState  collects information about the plot (&lt;code&gt;null&lt;/code&gt;<a name="line.3686"></a>
<span class="sourceLineNo">3687</span>     *                   permitted).<a name="line.3687"></a>
<span class="sourceLineNo">3688</span>     *<a name="line.3688"></a>
<span class="sourceLineNo">3689</span>     * @return A map containing the state for each axis drawn.<a name="line.3689"></a>
<span class="sourceLineNo">3690</span>     */<a name="line.3690"></a>
<span class="sourceLineNo">3691</span>    protected Map drawAxes(Graphics2D g2,<a name="line.3691"></a>
<span class="sourceLineNo">3692</span>                           Rectangle2D plotArea,<a name="line.3692"></a>
<span class="sourceLineNo">3693</span>                           Rectangle2D dataArea,<a name="line.3693"></a>
<span class="sourceLineNo">3694</span>                           PlotRenderingInfo plotState) {<a name="line.3694"></a>
<span class="sourceLineNo">3695</span><a name="line.3695"></a>
<span class="sourceLineNo">3696</span>        AxisCollection axisCollection = new AxisCollection();<a name="line.3696"></a>
<span class="sourceLineNo">3697</span><a name="line.3697"></a>
<span class="sourceLineNo">3698</span>        // add domain axes to lists...<a name="line.3698"></a>
<span class="sourceLineNo">3699</span>        for (int index = 0; index &lt; this.domainAxes.size(); index++) {<a name="line.3699"></a>
<span class="sourceLineNo">3700</span>            ValueAxis axis = (ValueAxis) this.domainAxes.get(index);<a name="line.3700"></a>
<span class="sourceLineNo">3701</span>            if (axis != null) {<a name="line.3701"></a>
<span class="sourceLineNo">3702</span>                axisCollection.add(axis, getDomainAxisEdge(index));<a name="line.3702"></a>
<span class="sourceLineNo">3703</span>            }<a name="line.3703"></a>
<span class="sourceLineNo">3704</span>        }<a name="line.3704"></a>
<span class="sourceLineNo">3705</span><a name="line.3705"></a>
<span class="sourceLineNo">3706</span>        // add range axes to lists...<a name="line.3706"></a>
<span class="sourceLineNo">3707</span>        for (int index = 0; index &lt; this.rangeAxes.size(); index++) {<a name="line.3707"></a>
<span class="sourceLineNo">3708</span>            ValueAxis yAxis = (ValueAxis) this.rangeAxes.get(index);<a name="line.3708"></a>
<span class="sourceLineNo">3709</span>            if (yAxis != null) {<a name="line.3709"></a>
<span class="sourceLineNo">3710</span>                axisCollection.add(yAxis, getRangeAxisEdge(index));<a name="line.3710"></a>
<span class="sourceLineNo">3711</span>            }<a name="line.3711"></a>
<span class="sourceLineNo">3712</span>        }<a name="line.3712"></a>
<span class="sourceLineNo">3713</span><a name="line.3713"></a>
<span class="sourceLineNo">3714</span>        Map axisStateMap = new HashMap();<a name="line.3714"></a>
<span class="sourceLineNo">3715</span><a name="line.3715"></a>
<span class="sourceLineNo">3716</span>        // draw the top axes<a name="line.3716"></a>
<span class="sourceLineNo">3717</span>        double cursor = dataArea.getMinY() - this.axisOffset.calculateTopOutset(<a name="line.3717"></a>
<span class="sourceLineNo">3718</span>                dataArea.getHeight());<a name="line.3718"></a>
<span class="sourceLineNo">3719</span>        Iterator iterator = axisCollection.getAxesAtTop().iterator();<a name="line.3719"></a>
<span class="sourceLineNo">3720</span>        while (iterator.hasNext()) {<a name="line.3720"></a>
<span class="sourceLineNo">3721</span>            ValueAxis axis = (ValueAxis) iterator.next();<a name="line.3721"></a>
<span class="sourceLineNo">3722</span>            AxisState info = axis.draw(g2, cursor, plotArea, dataArea,<a name="line.3722"></a>
<span class="sourceLineNo">3723</span>                    RectangleEdge.TOP, plotState);<a name="line.3723"></a>
<span class="sourceLineNo">3724</span>            cursor = info.getCursor();<a name="line.3724"></a>
<span class="sourceLineNo">3725</span>            axisStateMap.put(axis, info);<a name="line.3725"></a>
<span class="sourceLineNo">3726</span>        }<a name="line.3726"></a>
<span class="sourceLineNo">3727</span><a name="line.3727"></a>
<span class="sourceLineNo">3728</span>        // draw the bottom axes<a name="line.3728"></a>
<span class="sourceLineNo">3729</span>        cursor = dataArea.getMaxY()<a name="line.3729"></a>
<span class="sourceLineNo">3730</span>                 + this.axisOffset.calculateBottomOutset(dataArea.getHeight());<a name="line.3730"></a>
<span class="sourceLineNo">3731</span>        iterator = axisCollection.getAxesAtBottom().iterator();<a name="line.3731"></a>
<span class="sourceLineNo">3732</span>        while (iterator.hasNext()) {<a name="line.3732"></a>
<span class="sourceLineNo">3733</span>            ValueAxis axis = (ValueAxis) iterator.next();<a name="line.3733"></a>
<span class="sourceLineNo">3734</span>            AxisState info = axis.draw(g2, cursor, plotArea, dataArea,<a name="line.3734"></a>
<span class="sourceLineNo">3735</span>                    RectangleEdge.BOTTOM, plotState);<a name="line.3735"></a>
<span class="sourceLineNo">3736</span>            cursor = info.getCursor();<a name="line.3736"></a>
<span class="sourceLineNo">3737</span>            axisStateMap.put(axis, info);<a name="line.3737"></a>
<span class="sourceLineNo">3738</span>        }<a name="line.3738"></a>
<span class="sourceLineNo">3739</span><a name="line.3739"></a>
<span class="sourceLineNo">3740</span>        // draw the left axes<a name="line.3740"></a>
<span class="sourceLineNo">3741</span>        cursor = dataArea.getMinX()<a name="line.3741"></a>
<span class="sourceLineNo">3742</span>                 - this.axisOffset.calculateLeftOutset(dataArea.getWidth());<a name="line.3742"></a>
<span class="sourceLineNo">3743</span>        iterator = axisCollection.getAxesAtLeft().iterator();<a name="line.3743"></a>
<span class="sourceLineNo">3744</span>        while (iterator.hasNext()) {<a name="line.3744"></a>
<span class="sourceLineNo">3745</span>            ValueAxis axis = (ValueAxis) iterator.next();<a name="line.3745"></a>
<span class="sourceLineNo">3746</span>            AxisState info = axis.draw(g2, cursor, plotArea, dataArea,<a name="line.3746"></a>
<span class="sourceLineNo">3747</span>                    RectangleEdge.LEFT, plotState);<a name="line.3747"></a>
<span class="sourceLineNo">3748</span>            cursor = info.getCursor();<a name="line.3748"></a>
<span class="sourceLineNo">3749</span>            axisStateMap.put(axis, info);<a name="line.3749"></a>
<span class="sourceLineNo">3750</span>        }<a name="line.3750"></a>
<span class="sourceLineNo">3751</span><a name="line.3751"></a>
<span class="sourceLineNo">3752</span>        // draw the right axes<a name="line.3752"></a>
<span class="sourceLineNo">3753</span>        cursor = dataArea.getMaxX()<a name="line.3753"></a>
<span class="sourceLineNo">3754</span>                 + this.axisOffset.calculateRightOutset(dataArea.getWidth());<a name="line.3754"></a>
<span class="sourceLineNo">3755</span>        iterator = axisCollection.getAxesAtRight().iterator();<a name="line.3755"></a>
<span class="sourceLineNo">3756</span>        while (iterator.hasNext()) {<a name="line.3756"></a>
<span class="sourceLineNo">3757</span>            ValueAxis axis = (ValueAxis) iterator.next();<a name="line.3757"></a>
<span class="sourceLineNo">3758</span>            AxisState info = axis.draw(g2, cursor, plotArea, dataArea,<a name="line.3758"></a>
<span class="sourceLineNo">3759</span>                    RectangleEdge.RIGHT, plotState);<a name="line.3759"></a>
<span class="sourceLineNo">3760</span>            cursor = info.getCursor();<a name="line.3760"></a>
<span class="sourceLineNo">3761</span>            axisStateMap.put(axis, info);<a name="line.3761"></a>
<span class="sourceLineNo">3762</span>        }<a name="line.3762"></a>
<span class="sourceLineNo">3763</span><a name="line.3763"></a>
<span class="sourceLineNo">3764</span>        return axisStateMap;<a name="line.3764"></a>
<span class="sourceLineNo">3765</span>    }<a name="line.3765"></a>
<span class="sourceLineNo">3766</span><a name="line.3766"></a>
<span class="sourceLineNo">3767</span>    /**<a name="line.3767"></a>
<span class="sourceLineNo">3768</span>     * Draws a representation of the data within the dataArea region, using the<a name="line.3768"></a>
<span class="sourceLineNo">3769</span>     * current renderer.<a name="line.3769"></a>
<span class="sourceLineNo">3770</span>     * &lt;P&gt;<a name="line.3770"></a>
<span class="sourceLineNo">3771</span>     * The &lt;code&gt;info&lt;/code&gt; and &lt;code&gt;crosshairState&lt;/code&gt; arguments may be<a name="line.3771"></a>
<span class="sourceLineNo">3772</span>     * &lt;code&gt;null&lt;/code&gt;.<a name="line.3772"></a>
<span class="sourceLineNo">3773</span>     *<a name="line.3773"></a>
<span class="sourceLineNo">3774</span>     * @param g2  the graphics device.<a name="line.3774"></a>
<span class="sourceLineNo">3775</span>     * @param dataArea  the region in which the data is to be drawn.<a name="line.3775"></a>
<span class="sourceLineNo">3776</span>     * @param index  the dataset index.<a name="line.3776"></a>
<span class="sourceLineNo">3777</span>     * @param info  an optional object for collection dimension information.<a name="line.3777"></a>
<span class="sourceLineNo">3778</span>     * @param crosshairState  collects crosshair information<a name="line.3778"></a>
<span class="sourceLineNo">3779</span>     *                        (&lt;code&gt;null&lt;/code&gt; permitted).<a name="line.3779"></a>
<span class="sourceLineNo">3780</span>     *<a name="line.3780"></a>
<span class="sourceLineNo">3781</span>     * @return A flag that indicates whether any data was actually rendered.<a name="line.3781"></a>
<span class="sourceLineNo">3782</span>     */<a name="line.3782"></a>
<span class="sourceLineNo">3783</span>    public boolean render(Graphics2D g2, Rectangle2D dataArea, int index,<a name="line.3783"></a>
<span class="sourceLineNo">3784</span>            PlotRenderingInfo info, CrosshairState crosshairState) {<a name="line.3784"></a>
<span class="sourceLineNo">3785</span><a name="line.3785"></a>
<span class="sourceLineNo">3786</span>        boolean foundData = false;<a name="line.3786"></a>
<span class="sourceLineNo">3787</span>        XYDataset dataset = getDataset(index);<a name="line.3787"></a>
<span class="sourceLineNo">3788</span>        if (!DatasetUtilities.isEmptyOrNull(dataset)) {<a name="line.3788"></a>
<span class="sourceLineNo">3789</span>            foundData = true;<a name="line.3789"></a>
<span class="sourceLineNo">3790</span>            ValueAxis xAxis = getDomainAxisForDataset(index);<a name="line.3790"></a>
<span class="sourceLineNo">3791</span>            ValueAxis yAxis = getRangeAxisForDataset(index);<a name="line.3791"></a>
<span class="sourceLineNo">3792</span>            if (xAxis == null || yAxis == null) {<a name="line.3792"></a>
<span class="sourceLineNo">3793</span>                return foundData;  // can't render anything without axes<a name="line.3793"></a>
<span class="sourceLineNo">3794</span>            }<a name="line.3794"></a>
<span class="sourceLineNo">3795</span>            XYItemRenderer renderer = getRenderer(index);<a name="line.3795"></a>
<span class="sourceLineNo">3796</span>            if (renderer == null) {<a name="line.3796"></a>
<span class="sourceLineNo">3797</span>                renderer = getRenderer();<a name="line.3797"></a>
<span class="sourceLineNo">3798</span>                if (renderer == null) { // no default renderer available<a name="line.3798"></a>
<span class="sourceLineNo">3799</span>                    return foundData;<a name="line.3799"></a>
<span class="sourceLineNo">3800</span>                }<a name="line.3800"></a>
<span class="sourceLineNo">3801</span>            }<a name="line.3801"></a>
<span class="sourceLineNo">3802</span><a name="line.3802"></a>
<span class="sourceLineNo">3803</span>            XYItemRendererState state = renderer.initialise(g2, dataArea, this,<a name="line.3803"></a>
<span class="sourceLineNo">3804</span>                    dataset, info);<a name="line.3804"></a>
<span class="sourceLineNo">3805</span>            int passCount = renderer.getPassCount();<a name="line.3805"></a>
<span class="sourceLineNo">3806</span><a name="line.3806"></a>
<span class="sourceLineNo">3807</span>            SeriesRenderingOrder seriesOrder = getSeriesRenderingOrder();<a name="line.3807"></a>
<span class="sourceLineNo">3808</span>            if (seriesOrder == SeriesRenderingOrder.REVERSE) {<a name="line.3808"></a>
<span class="sourceLineNo">3809</span>                //render series in reverse order<a name="line.3809"></a>
<span class="sourceLineNo">3810</span>                for (int pass = 0; pass &lt; passCount; pass++) {<a name="line.3810"></a>
<span class="sourceLineNo">3811</span>                    int seriesCount = dataset.getSeriesCount();<a name="line.3811"></a>
<span class="sourceLineNo">3812</span>                    for (int series = seriesCount - 1; series &gt;= 0; series--) {<a name="line.3812"></a>
<span class="sourceLineNo">3813</span>                        int firstItem = 0;<a name="line.3813"></a>
<span class="sourceLineNo">3814</span>                        int lastItem = dataset.getItemCount(series) - 1;<a name="line.3814"></a>
<span class="sourceLineNo">3815</span>                        if (lastItem == -1) {<a name="line.3815"></a>
<span class="sourceLineNo">3816</span>                            continue;<a name="line.3816"></a>
<span class="sourceLineNo">3817</span>                        }<a name="line.3817"></a>
<span class="sourceLineNo">3818</span>                        if (state.getProcessVisibleItemsOnly()) {<a name="line.3818"></a>
<span class="sourceLineNo">3819</span>                            int[] itemBounds = RendererUtilities.findLiveItems(<a name="line.3819"></a>
<span class="sourceLineNo">3820</span>                                    dataset, series, xAxis.getLowerBound(),<a name="line.3820"></a>
<span class="sourceLineNo">3821</span>                                    xAxis.getUpperBound());<a name="line.3821"></a>
<span class="sourceLineNo">3822</span>                            firstItem = Math.max(itemBounds[0] - 1, 0);<a name="line.3822"></a>
<span class="sourceLineNo">3823</span>                            lastItem = Math.min(itemBounds[1] + 1, lastItem);<a name="line.3823"></a>
<span class="sourceLineNo">3824</span>                        }<a name="line.3824"></a>
<span class="sourceLineNo">3825</span>                        state.startSeriesPass(dataset, series, firstItem,<a name="line.3825"></a>
<span class="sourceLineNo">3826</span>                                lastItem, pass, passCount);<a name="line.3826"></a>
<span class="sourceLineNo">3827</span>                        for (int item = firstItem; item &lt;= lastItem; item++) {<a name="line.3827"></a>
<span class="sourceLineNo">3828</span>                            renderer.drawItem(g2, state, dataArea, info,<a name="line.3828"></a>
<span class="sourceLineNo">3829</span>                                    this, xAxis, yAxis, dataset, series, item,<a name="line.3829"></a>
<span class="sourceLineNo">3830</span>                                    crosshairState, pass);<a name="line.3830"></a>
<span class="sourceLineNo">3831</span>                        }<a name="line.3831"></a>
<span class="sourceLineNo">3832</span>                        state.endSeriesPass(dataset, series, firstItem,<a name="line.3832"></a>
<span class="sourceLineNo">3833</span>                                lastItem, pass, passCount);<a name="line.3833"></a>
<span class="sourceLineNo">3834</span>                    }<a name="line.3834"></a>
<span class="sourceLineNo">3835</span>                }<a name="line.3835"></a>
<span class="sourceLineNo">3836</span>            }<a name="line.3836"></a>
<span class="sourceLineNo">3837</span>            else {<a name="line.3837"></a>
<span class="sourceLineNo">3838</span>                //render series in forward order<a name="line.3838"></a>
<span class="sourceLineNo">3839</span>                for (int pass = 0; pass &lt; passCount; pass++) {<a name="line.3839"></a>
<span class="sourceLineNo">3840</span>                    int seriesCount = dataset.getSeriesCount();<a name="line.3840"></a>
<span class="sourceLineNo">3841</span>                    for (int series = 0; series &lt; seriesCount; series++) {<a name="line.3841"></a>
<span class="sourceLineNo">3842</span>                        int firstItem = 0;<a name="line.3842"></a>
<span class="sourceLineNo">3843</span>                        int lastItem = dataset.getItemCount(series) - 1;<a name="line.3843"></a>
<span class="sourceLineNo">3844</span>                        if (state.getProcessVisibleItemsOnly()) {<a name="line.3844"></a>
<span class="sourceLineNo">3845</span>                            int[] itemBounds = RendererUtilities.findLiveItems(<a name="line.3845"></a>
<span class="sourceLineNo">3846</span>                                    dataset, series, xAxis.getLowerBound(),<a name="line.3846"></a>
<span class="sourceLineNo">3847</span>                                    xAxis.getUpperBound());<a name="line.3847"></a>
<span class="sourceLineNo">3848</span>                            firstItem = Math.max(itemBounds[0] - 1, 0);<a name="line.3848"></a>
<span class="sourceLineNo">3849</span>                            lastItem = Math.min(itemBounds[1] + 1, lastItem);<a name="line.3849"></a>
<span class="sourceLineNo">3850</span>                        }<a name="line.3850"></a>
<span class="sourceLineNo">3851</span>                        state.startSeriesPass(dataset, series, firstItem,<a name="line.3851"></a>
<span class="sourceLineNo">3852</span>                                lastItem, pass, passCount);<a name="line.3852"></a>
<span class="sourceLineNo">3853</span>                        for (int item = firstItem; item &lt;= lastItem; item++) {<a name="line.3853"></a>
<span class="sourceLineNo">3854</span>                            renderer.drawItem(g2, state, dataArea, info,<a name="line.3854"></a>
<span class="sourceLineNo">3855</span>                                    this, xAxis, yAxis, dataset, series, item,<a name="line.3855"></a>
<span class="sourceLineNo">3856</span>                                    crosshairState, pass);<a name="line.3856"></a>
<span class="sourceLineNo">3857</span>                        }<a name="line.3857"></a>
<span class="sourceLineNo">3858</span>                        state.endSeriesPass(dataset, series, firstItem,<a name="line.3858"></a>
<span class="sourceLineNo">3859</span>                                lastItem, pass, passCount);<a name="line.3859"></a>
<span class="sourceLineNo">3860</span>                    }<a name="line.3860"></a>
<span class="sourceLineNo">3861</span>                }<a name="line.3861"></a>
<span class="sourceLineNo">3862</span>            }<a name="line.3862"></a>
<span class="sourceLineNo">3863</span>        }<a name="line.3863"></a>
<span class="sourceLineNo">3864</span>        return foundData;<a name="line.3864"></a>
<span class="sourceLineNo">3865</span>    }<a name="line.3865"></a>
<span class="sourceLineNo">3866</span><a name="line.3866"></a>
<span class="sourceLineNo">3867</span>    /**<a name="line.3867"></a>
<span class="sourceLineNo">3868</span>     * Returns the domain axis for a dataset.<a name="line.3868"></a>
<span class="sourceLineNo">3869</span>     *<a name="line.3869"></a>
<span class="sourceLineNo">3870</span>     * @param index  the dataset index.<a name="line.3870"></a>
<span class="sourceLineNo">3871</span>     *<a name="line.3871"></a>
<span class="sourceLineNo">3872</span>     * @return The axis.<a name="line.3872"></a>
<span class="sourceLineNo">3873</span>     */<a name="line.3873"></a>
<span class="sourceLineNo">3874</span>    public ValueAxis getDomainAxisForDataset(int index) {<a name="line.3874"></a>
<span class="sourceLineNo">3875</span>        int upper = Math.max(getDatasetCount(), getRendererCount());<a name="line.3875"></a>
<span class="sourceLineNo">3876</span>        if (index &lt; 0 || index &gt;= upper) {<a name="line.3876"></a>
<span class="sourceLineNo">3877</span>            throw new IllegalArgumentException("Index " + index<a name="line.3877"></a>
<span class="sourceLineNo">3878</span>                    + " out of bounds.");<a name="line.3878"></a>
<span class="sourceLineNo">3879</span>        }<a name="line.3879"></a>
<span class="sourceLineNo">3880</span>        ValueAxis valueAxis = null;<a name="line.3880"></a>
<span class="sourceLineNo">3881</span>        List axisIndices = (List) this.datasetToDomainAxesMap.get(<a name="line.3881"></a>
<span class="sourceLineNo">3882</span>                new Integer(index));<a name="line.3882"></a>
<span class="sourceLineNo">3883</span>        if (axisIndices != null) {<a name="line.3883"></a>
<span class="sourceLineNo">3884</span>            // the first axis in the list is used for data &lt;--&gt; Java2D<a name="line.3884"></a>
<span class="sourceLineNo">3885</span>            Integer axisIndex = (Integer) axisIndices.get(0);<a name="line.3885"></a>
<span class="sourceLineNo">3886</span>            valueAxis = getDomainAxis(axisIndex.intValue());<a name="line.3886"></a>
<span class="sourceLineNo">3887</span>        }<a name="line.3887"></a>
<span class="sourceLineNo">3888</span>        else {<a name="line.3888"></a>
<span class="sourceLineNo">3889</span>            valueAxis = getDomainAxis(0);<a name="line.3889"></a>
<span class="sourceLineNo">3890</span>        }<a name="line.3890"></a>
<span class="sourceLineNo">3891</span>        return valueAxis;<a name="line.3891"></a>
<span class="sourceLineNo">3892</span>    }<a name="line.3892"></a>
<span class="sourceLineNo">3893</span><a name="line.3893"></a>
<span class="sourceLineNo">3894</span>    /**<a name="line.3894"></a>
<span class="sourceLineNo">3895</span>     * Returns the range axis for a dataset.<a name="line.3895"></a>
<span class="sourceLineNo">3896</span>     *<a name="line.3896"></a>
<span class="sourceLineNo">3897</span>     * @param index  the dataset index.<a name="line.3897"></a>
<span class="sourceLineNo">3898</span>     *<a name="line.3898"></a>
<span class="sourceLineNo">3899</span>     * @return The axis.<a name="line.3899"></a>
<span class="sourceLineNo">3900</span>     */<a name="line.3900"></a>
<span class="sourceLineNo">3901</span>    public ValueAxis getRangeAxisForDataset(int index) {<a name="line.3901"></a>
<span class="sourceLineNo">3902</span>        int upper = Math.max(getDatasetCount(), getRendererCount());<a name="line.3902"></a>
<span class="sourceLineNo">3903</span>        if (index &lt; 0 || index &gt;= upper) {<a name="line.3903"></a>
<span class="sourceLineNo">3904</span>            throw new IllegalArgumentException("Index " + index<a name="line.3904"></a>
<span class="sourceLineNo">3905</span>                    + " out of bounds.");<a name="line.3905"></a>
<span class="sourceLineNo">3906</span>        }<a name="line.3906"></a>
<span class="sourceLineNo">3907</span>        ValueAxis valueAxis = null;<a name="line.3907"></a>
<span class="sourceLineNo">3908</span>        List axisIndices = (List) this.datasetToRangeAxesMap.get(<a name="line.3908"></a>
<span class="sourceLineNo">3909</span>                new Integer(index));<a name="line.3909"></a>
<span class="sourceLineNo">3910</span>        if (axisIndices != null) {<a name="line.3910"></a>
<span class="sourceLineNo">3911</span>            // the first axis in the list is used for data &lt;--&gt; Java2D<a name="line.3911"></a>
<span class="sourceLineNo">3912</span>            Integer axisIndex = (Integer) axisIndices.get(0);<a name="line.3912"></a>
<span class="sourceLineNo">3913</span>            valueAxis = getRangeAxis(axisIndex.intValue());<a name="line.3913"></a>
<span class="sourceLineNo">3914</span>        }<a name="line.3914"></a>
<span class="sourceLineNo">3915</span>        else {<a name="line.3915"></a>
<span class="sourceLineNo">3916</span>            valueAxis = getRangeAxis(0);<a name="line.3916"></a>
<span class="sourceLineNo">3917</span>        }<a name="line.3917"></a>
<span class="sourceLineNo">3918</span>        return valueAxis;<a name="line.3918"></a>
<span class="sourceLineNo">3919</span>    }<a name="line.3919"></a>
<span class="sourceLineNo">3920</span><a name="line.3920"></a>
<span class="sourceLineNo">3921</span>    /**<a name="line.3921"></a>
<span class="sourceLineNo">3922</span>     * Draws the gridlines for the plot, if they are visible.<a name="line.3922"></a>
<span class="sourceLineNo">3923</span>     *<a name="line.3923"></a>
<span class="sourceLineNo">3924</span>     * @param g2  the graphics device.<a name="line.3924"></a>
<span class="sourceLineNo">3925</span>     * @param dataArea  the data area.<a name="line.3925"></a>
<span class="sourceLineNo">3926</span>     * @param ticks  the ticks.<a name="line.3926"></a>
<span class="sourceLineNo">3927</span>     *<a name="line.3927"></a>
<span class="sourceLineNo">3928</span>     * @see #drawRangeGridlines(Graphics2D, Rectangle2D, List)<a name="line.3928"></a>
<span class="sourceLineNo">3929</span>     */<a name="line.3929"></a>
<span class="sourceLineNo">3930</span>    protected void drawDomainGridlines(Graphics2D g2, Rectangle2D dataArea,<a name="line.3930"></a>
<span class="sourceLineNo">3931</span>                                       List ticks) {<a name="line.3931"></a>
<span class="sourceLineNo">3932</span><a name="line.3932"></a>
<span class="sourceLineNo">3933</span>        // no renderer, no gridlines...<a name="line.3933"></a>
<span class="sourceLineNo">3934</span>        if (getRenderer() == null) {<a name="line.3934"></a>
<span class="sourceLineNo">3935</span>            return;<a name="line.3935"></a>
<span class="sourceLineNo">3936</span>        }<a name="line.3936"></a>
<span class="sourceLineNo">3937</span><a name="line.3937"></a>
<span class="sourceLineNo">3938</span>        // draw the domain grid lines, if any...<a name="line.3938"></a>
<span class="sourceLineNo">3939</span>        if (isDomainGridlinesVisible() || isDomainMinorGridlinesVisible()) {<a name="line.3939"></a>
<span class="sourceLineNo">3940</span>            Stroke gridStroke = null;<a name="line.3940"></a>
<span class="sourceLineNo">3941</span>            Paint gridPaint = null;<a name="line.3941"></a>
<span class="sourceLineNo">3942</span>            Iterator iterator = ticks.iterator();<a name="line.3942"></a>
<span class="sourceLineNo">3943</span>            boolean paintLine = false;<a name="line.3943"></a>
<span class="sourceLineNo">3944</span>            while (iterator.hasNext()) {<a name="line.3944"></a>
<span class="sourceLineNo">3945</span>                paintLine = false;<a name="line.3945"></a>
<span class="sourceLineNo">3946</span>                ValueTick tick = (ValueTick) iterator.next();<a name="line.3946"></a>
<span class="sourceLineNo">3947</span>                if ((tick.getTickType() == TickType.MINOR) <a name="line.3947"></a>
<span class="sourceLineNo">3948</span>                        &amp;&amp; isDomainMinorGridlinesVisible()) {<a name="line.3948"></a>
<span class="sourceLineNo">3949</span>                    gridStroke = getDomainMinorGridlineStroke();<a name="line.3949"></a>
<span class="sourceLineNo">3950</span>                    gridPaint = getDomainMinorGridlinePaint();<a name="line.3950"></a>
<span class="sourceLineNo">3951</span>                    paintLine = true;<a name="line.3951"></a>
<span class="sourceLineNo">3952</span>                }<a name="line.3952"></a>
<span class="sourceLineNo">3953</span>                else if ((tick.getTickType() == TickType.MAJOR) <a name="line.3953"></a>
<span class="sourceLineNo">3954</span>                        &amp;&amp; isDomainGridlinesVisible()) {<a name="line.3954"></a>
<span class="sourceLineNo">3955</span>                    gridStroke = getDomainGridlineStroke();<a name="line.3955"></a>
<span class="sourceLineNo">3956</span>                    gridPaint = getDomainGridlinePaint();<a name="line.3956"></a>
<span class="sourceLineNo">3957</span>                    paintLine = true;<a name="line.3957"></a>
<span class="sourceLineNo">3958</span>                }<a name="line.3958"></a>
<span class="sourceLineNo">3959</span>                XYItemRenderer r = getRenderer();<a name="line.3959"></a>
<span class="sourceLineNo">3960</span>                if ((r instanceof AbstractXYItemRenderer) &amp;&amp; paintLine) {<a name="line.3960"></a>
<span class="sourceLineNo">3961</span>                    ((AbstractXYItemRenderer) r).drawDomainLine(g2, this,<a name="line.3961"></a>
<span class="sourceLineNo">3962</span>                            getDomainAxis(), dataArea, tick.getValue(),<a name="line.3962"></a>
<span class="sourceLineNo">3963</span>                            gridPaint, gridStroke);<a name="line.3963"></a>
<span class="sourceLineNo">3964</span>                }<a name="line.3964"></a>
<span class="sourceLineNo">3965</span>            }<a name="line.3965"></a>
<span class="sourceLineNo">3966</span>        }<a name="line.3966"></a>
<span class="sourceLineNo">3967</span>    }<a name="line.3967"></a>
<span class="sourceLineNo">3968</span><a name="line.3968"></a>
<span class="sourceLineNo">3969</span>    /**<a name="line.3969"></a>
<span class="sourceLineNo">3970</span>     * Draws the gridlines for the plot's primary range axis, if they are<a name="line.3970"></a>
<span class="sourceLineNo">3971</span>     * visible.<a name="line.3971"></a>
<span class="sourceLineNo">3972</span>     *<a name="line.3972"></a>
<span class="sourceLineNo">3973</span>     * @param g2  the graphics device.<a name="line.3973"></a>
<span class="sourceLineNo">3974</span>     * @param area  the data area.<a name="line.3974"></a>
<span class="sourceLineNo">3975</span>     * @param ticks  the ticks.<a name="line.3975"></a>
<span class="sourceLineNo">3976</span>     *<a name="line.3976"></a>
<span class="sourceLineNo">3977</span>     * @see #drawDomainGridlines(Graphics2D, Rectangle2D, List)<a name="line.3977"></a>
<span class="sourceLineNo">3978</span>     */<a name="line.3978"></a>
<span class="sourceLineNo">3979</span>    protected void drawRangeGridlines(Graphics2D g2, Rectangle2D area,<a name="line.3979"></a>
<span class="sourceLineNo">3980</span>                                      List ticks) {<a name="line.3980"></a>
<span class="sourceLineNo">3981</span><a name="line.3981"></a>
<span class="sourceLineNo">3982</span>        // no renderer, no gridlines...<a name="line.3982"></a>
<span class="sourceLineNo">3983</span>        if (getRenderer() == null) {<a name="line.3983"></a>
<span class="sourceLineNo">3984</span>            return;<a name="line.3984"></a>
<span class="sourceLineNo">3985</span>        }<a name="line.3985"></a>
<span class="sourceLineNo">3986</span><a name="line.3986"></a>
<span class="sourceLineNo">3987</span>        // draw the range grid lines, if any...<a name="line.3987"></a>
<span class="sourceLineNo">3988</span>        if (isRangeGridlinesVisible() || isRangeMinorGridlinesVisible()) {<a name="line.3988"></a>
<span class="sourceLineNo">3989</span>            Stroke gridStroke = null;<a name="line.3989"></a>
<span class="sourceLineNo">3990</span>            Paint gridPaint = null;<a name="line.3990"></a>
<span class="sourceLineNo">3991</span>            ValueAxis axis = getRangeAxis();<a name="line.3991"></a>
<span class="sourceLineNo">3992</span>            if (axis != null) {<a name="line.3992"></a>
<span class="sourceLineNo">3993</span>                Iterator iterator = ticks.iterator();<a name="line.3993"></a>
<span class="sourceLineNo">3994</span>                boolean paintLine = false;<a name="line.3994"></a>
<span class="sourceLineNo">3995</span>                while (iterator.hasNext()) {<a name="line.3995"></a>
<span class="sourceLineNo">3996</span>                    paintLine = false;<a name="line.3996"></a>
<span class="sourceLineNo">3997</span>                    ValueTick tick = (ValueTick) iterator.next();<a name="line.3997"></a>
<span class="sourceLineNo">3998</span>                    if ((tick.getTickType() == TickType.MINOR)<a name="line.3998"></a>
<span class="sourceLineNo">3999</span>                            &amp;&amp; isRangeMinorGridlinesVisible()) {<a name="line.3999"></a>
<span class="sourceLineNo">4000</span>                        gridStroke = getRangeMinorGridlineStroke();<a name="line.4000"></a>
<span class="sourceLineNo">4001</span>                        gridPaint = getRangeMinorGridlinePaint();<a name="line.4001"></a>
<span class="sourceLineNo">4002</span>                        paintLine = true;<a name="line.4002"></a>
<span class="sourceLineNo">4003</span>                    }<a name="line.4003"></a>
<span class="sourceLineNo">4004</span>                    else if ((tick.getTickType() == TickType.MAJOR)<a name="line.4004"></a>
<span class="sourceLineNo">4005</span>                            &amp;&amp; isRangeGridlinesVisible()) {<a name="line.4005"></a>
<span class="sourceLineNo">4006</span>                        gridStroke = getRangeGridlineStroke();<a name="line.4006"></a>
<span class="sourceLineNo">4007</span>                        gridPaint = getRangeGridlinePaint();<a name="line.4007"></a>
<span class="sourceLineNo">4008</span>                        paintLine = true;<a name="line.4008"></a>
<span class="sourceLineNo">4009</span>                    }<a name="line.4009"></a>
<span class="sourceLineNo">4010</span>                    if ((tick.getValue() != 0.0<a name="line.4010"></a>
<span class="sourceLineNo">4011</span>                            || !isRangeZeroBaselineVisible()) &amp;&amp; paintLine) {<a name="line.4011"></a>
<span class="sourceLineNo">4012</span>                        getRenderer().drawRangeLine(g2, this, getRangeAxis(),<a name="line.4012"></a>
<span class="sourceLineNo">4013</span>                                area, tick.getValue(), gridPaint, gridStroke);<a name="line.4013"></a>
<span class="sourceLineNo">4014</span>                    }<a name="line.4014"></a>
<span class="sourceLineNo">4015</span>                }<a name="line.4015"></a>
<span class="sourceLineNo">4016</span>            }<a name="line.4016"></a>
<span class="sourceLineNo">4017</span>        }<a name="line.4017"></a>
<span class="sourceLineNo">4018</span>    }<a name="line.4018"></a>
<span class="sourceLineNo">4019</span><a name="line.4019"></a>
<span class="sourceLineNo">4020</span>    /**<a name="line.4020"></a>
<span class="sourceLineNo">4021</span>     * Draws a base line across the chart at value zero on the domain axis.<a name="line.4021"></a>
<span class="sourceLineNo">4022</span>     *<a name="line.4022"></a>
<span class="sourceLineNo">4023</span>     * @param g2  the graphics device.<a name="line.4023"></a>
<span class="sourceLineNo">4024</span>     * @param area  the data area.<a name="line.4024"></a>
<span class="sourceLineNo">4025</span>     *<a name="line.4025"></a>
<span class="sourceLineNo">4026</span>     * @see #setDomainZeroBaselineVisible(boolean)<a name="line.4026"></a>
<span class="sourceLineNo">4027</span>     *<a name="line.4027"></a>
<span class="sourceLineNo">4028</span>     * @since 1.0.5<a name="line.4028"></a>
<span class="sourceLineNo">4029</span>     */<a name="line.4029"></a>
<span class="sourceLineNo">4030</span>    protected void drawZeroDomainBaseline(Graphics2D g2, Rectangle2D area) {<a name="line.4030"></a>
<span class="sourceLineNo">4031</span>        if (isDomainZeroBaselineVisible()) {<a name="line.4031"></a>
<span class="sourceLineNo">4032</span>            XYItemRenderer r = getRenderer();<a name="line.4032"></a>
<span class="sourceLineNo">4033</span>            // FIXME: the renderer interface doesn't have the drawDomainLine()<a name="line.4033"></a>
<span class="sourceLineNo">4034</span>            // method, so we have to rely on the renderer being a subclass of<a name="line.4034"></a>
<span class="sourceLineNo">4035</span>            // AbstractXYItemRenderer (which is lame)<a name="line.4035"></a>
<span class="sourceLineNo">4036</span>            if (r instanceof AbstractXYItemRenderer) {<a name="line.4036"></a>
<span class="sourceLineNo">4037</span>                AbstractXYItemRenderer renderer = (AbstractXYItemRenderer) r;<a name="line.4037"></a>
<span class="sourceLineNo">4038</span>                renderer.drawDomainLine(g2, this, getDomainAxis(), area, 0.0,<a name="line.4038"></a>
<span class="sourceLineNo">4039</span>                        this.domainZeroBaselinePaint,<a name="line.4039"></a>
<span class="sourceLineNo">4040</span>                        this.domainZeroBaselineStroke);<a name="line.4040"></a>
<span class="sourceLineNo">4041</span>            }<a name="line.4041"></a>
<span class="sourceLineNo">4042</span>        }<a name="line.4042"></a>
<span class="sourceLineNo">4043</span>    }<a name="line.4043"></a>
<span class="sourceLineNo">4044</span><a name="line.4044"></a>
<span class="sourceLineNo">4045</span>    /**<a name="line.4045"></a>
<span class="sourceLineNo">4046</span>     * Draws a base line across the chart at value zero on the range axis.<a name="line.4046"></a>
<span class="sourceLineNo">4047</span>     *<a name="line.4047"></a>
<span class="sourceLineNo">4048</span>     * @param g2  the graphics device.<a name="line.4048"></a>
<span class="sourceLineNo">4049</span>     * @param area  the data area.<a name="line.4049"></a>
<span class="sourceLineNo">4050</span>     *<a name="line.4050"></a>
<span class="sourceLineNo">4051</span>     * @see #setRangeZeroBaselineVisible(boolean)<a name="line.4051"></a>
<span class="sourceLineNo">4052</span>     */<a name="line.4052"></a>
<span class="sourceLineNo">4053</span>    protected void drawZeroRangeBaseline(Graphics2D g2, Rectangle2D area) {<a name="line.4053"></a>
<span class="sourceLineNo">4054</span>        if (isRangeZeroBaselineVisible()) {<a name="line.4054"></a>
<span class="sourceLineNo">4055</span>            getRenderer().drawRangeLine(g2, this, getRangeAxis(), area, 0.0,<a name="line.4055"></a>
<span class="sourceLineNo">4056</span>                    this.rangeZeroBaselinePaint, this.rangeZeroBaselineStroke);<a name="line.4056"></a>
<span class="sourceLineNo">4057</span>        }<a name="line.4057"></a>
<span class="sourceLineNo">4058</span>    }<a name="line.4058"></a>
<span class="sourceLineNo">4059</span><a name="line.4059"></a>
<span class="sourceLineNo">4060</span>    /**<a name="line.4060"></a>
<span class="sourceLineNo">4061</span>     * Draws the annotations for the plot.<a name="line.4061"></a>
<span class="sourceLineNo">4062</span>     *<a name="line.4062"></a>
<span class="sourceLineNo">4063</span>     * @param g2  the graphics device.<a name="line.4063"></a>
<span class="sourceLineNo">4064</span>     * @param dataArea  the data area.<a name="line.4064"></a>
<span class="sourceLineNo">4065</span>     * @param info  the chart rendering info.<a name="line.4065"></a>
<span class="sourceLineNo">4066</span>     */<a name="line.4066"></a>
<span class="sourceLineNo">4067</span>    public void drawAnnotations(Graphics2D g2,<a name="line.4067"></a>
<span class="sourceLineNo">4068</span>                                Rectangle2D dataArea,<a name="line.4068"></a>
<span class="sourceLineNo">4069</span>                                PlotRenderingInfo info) {<a name="line.4069"></a>
<span class="sourceLineNo">4070</span><a name="line.4070"></a>
<span class="sourceLineNo">4071</span>        Iterator iterator = this.annotations.iterator();<a name="line.4071"></a>
<span class="sourceLineNo">4072</span>        while (iterator.hasNext()) {<a name="line.4072"></a>
<span class="sourceLineNo">4073</span>            XYAnnotation annotation = (XYAnnotation) iterator.next();<a name="line.4073"></a>
<span class="sourceLineNo">4074</span>            ValueAxis xAxis = getDomainAxis();<a name="line.4074"></a>
<span class="sourceLineNo">4075</span>            ValueAxis yAxis = getRangeAxis();<a name="line.4075"></a>
<span class="sourceLineNo">4076</span>            annotation.draw(g2, this, dataArea, xAxis, yAxis, 0, info);<a name="line.4076"></a>
<span class="sourceLineNo">4077</span>        }<a name="line.4077"></a>
<span class="sourceLineNo">4078</span><a name="line.4078"></a>
<span class="sourceLineNo">4079</span>    }<a name="line.4079"></a>
<span class="sourceLineNo">4080</span><a name="line.4080"></a>
<span class="sourceLineNo">4081</span>    /**<a name="line.4081"></a>
<span class="sourceLineNo">4082</span>     * Draws the domain markers (if any) for an axis and layer.  This method is<a name="line.4082"></a>
<span class="sourceLineNo">4083</span>     * typically called from within the draw() method.<a name="line.4083"></a>
<span class="sourceLineNo">4084</span>     *<a name="line.4084"></a>
<span class="sourceLineNo">4085</span>     * @param g2  the graphics device.<a name="line.4085"></a>
<span class="sourceLineNo">4086</span>     * @param dataArea  the data area.<a name="line.4086"></a>
<span class="sourceLineNo">4087</span>     * @param index  the renderer index.<a name="line.4087"></a>
<span class="sourceLineNo">4088</span>     * @param layer  the layer (foreground or background).<a name="line.4088"></a>
<span class="sourceLineNo">4089</span>     */<a name="line.4089"></a>
<span class="sourceLineNo">4090</span>    protected void drawDomainMarkers(Graphics2D g2, Rectangle2D dataArea,<a name="line.4090"></a>
<span class="sourceLineNo">4091</span>                                     int index, Layer layer) {<a name="line.4091"></a>
<span class="sourceLineNo">4092</span><a name="line.4092"></a>
<span class="sourceLineNo">4093</span>        XYItemRenderer r = getRenderer(index);<a name="line.4093"></a>
<span class="sourceLineNo">4094</span>        if (r == null) {<a name="line.4094"></a>
<span class="sourceLineNo">4095</span>            return;<a name="line.4095"></a>
<span class="sourceLineNo">4096</span>        }<a name="line.4096"></a>
<span class="sourceLineNo">4097</span>        // check that the renderer has a corresponding dataset (it doesn't<a name="line.4097"></a>
<span class="sourceLineNo">4098</span>        // matter if the dataset is null)<a name="line.4098"></a>
<span class="sourceLineNo">4099</span>        if (index &gt;= getDatasetCount()) {<a name="line.4099"></a>
<span class="sourceLineNo">4100</span>            return;<a name="line.4100"></a>
<span class="sourceLineNo">4101</span>        }<a name="line.4101"></a>
<span class="sourceLineNo">4102</span>        Collection markers = getDomainMarkers(index, layer);<a name="line.4102"></a>
<span class="sourceLineNo">4103</span>        ValueAxis axis = getDomainAxisForDataset(index);<a name="line.4103"></a>
<span class="sourceLineNo">4104</span>        if (markers != null &amp;&amp; axis != null) {<a name="line.4104"></a>
<span class="sourceLineNo">4105</span>            Iterator iterator = markers.iterator();<a name="line.4105"></a>
<span class="sourceLineNo">4106</span>            while (iterator.hasNext()) {<a name="line.4106"></a>
<span class="sourceLineNo">4107</span>                Marker marker = (Marker) iterator.next();<a name="line.4107"></a>
<span class="sourceLineNo">4108</span>                r.drawDomainMarker(g2, this, axis, marker, dataArea);<a name="line.4108"></a>
<span class="sourceLineNo">4109</span>            }<a name="line.4109"></a>
<span class="sourceLineNo">4110</span>        }<a name="line.4110"></a>
<span class="sourceLineNo">4111</span><a name="line.4111"></a>
<span class="sourceLineNo">4112</span>    }<a name="line.4112"></a>
<span class="sourceLineNo">4113</span><a name="line.4113"></a>
<span class="sourceLineNo">4114</span>    /**<a name="line.4114"></a>
<span class="sourceLineNo">4115</span>     * Draws the range markers (if any) for a renderer and layer.  This method<a name="line.4115"></a>
<span class="sourceLineNo">4116</span>     * is typically called from within the draw() method.<a name="line.4116"></a>
<span class="sourceLineNo">4117</span>     *<a name="line.4117"></a>
<span class="sourceLineNo">4118</span>     * @param g2  the graphics device.<a name="line.4118"></a>
<span class="sourceLineNo">4119</span>     * @param dataArea  the data area.<a name="line.4119"></a>
<span class="sourceLineNo">4120</span>     * @param index  the renderer index.<a name="line.4120"></a>
<span class="sourceLineNo">4121</span>     * @param layer  the layer (foreground or background).<a name="line.4121"></a>
<span class="sourceLineNo">4122</span>     */<a name="line.4122"></a>
<span class="sourceLineNo">4123</span>    protected void drawRangeMarkers(Graphics2D g2, Rectangle2D dataArea,<a name="line.4123"></a>
<span class="sourceLineNo">4124</span>                                    int index, Layer layer) {<a name="line.4124"></a>
<span class="sourceLineNo">4125</span><a name="line.4125"></a>
<span class="sourceLineNo">4126</span>        XYItemRenderer r = getRenderer(index);<a name="line.4126"></a>
<span class="sourceLineNo">4127</span>        if (r == null) {<a name="line.4127"></a>
<span class="sourceLineNo">4128</span>            return;<a name="line.4128"></a>
<span class="sourceLineNo">4129</span>        }<a name="line.4129"></a>
<span class="sourceLineNo">4130</span>        // check that the renderer has a corresponding dataset (it doesn't<a name="line.4130"></a>
<span class="sourceLineNo">4131</span>        // matter if the dataset is null)<a name="line.4131"></a>
<span class="sourceLineNo">4132</span>        if (index &gt;= getDatasetCount()) {<a name="line.4132"></a>
<span class="sourceLineNo">4133</span>            return;<a name="line.4133"></a>
<span class="sourceLineNo">4134</span>        }<a name="line.4134"></a>
<span class="sourceLineNo">4135</span>        Collection markers = getRangeMarkers(index, layer);<a name="line.4135"></a>
<span class="sourceLineNo">4136</span>        ValueAxis axis = getRangeAxisForDataset(index);<a name="line.4136"></a>
<span class="sourceLineNo">4137</span>        if (markers != null &amp;&amp; axis != null) {<a name="line.4137"></a>
<span class="sourceLineNo">4138</span>            Iterator iterator = markers.iterator();<a name="line.4138"></a>
<span class="sourceLineNo">4139</span>            while (iterator.hasNext()) {<a name="line.4139"></a>
<span class="sourceLineNo">4140</span>                Marker marker = (Marker) iterator.next();<a name="line.4140"></a>
<span class="sourceLineNo">4141</span>                r.drawRangeMarker(g2, this, axis, marker, dataArea);<a name="line.4141"></a>
<span class="sourceLineNo">4142</span>            }<a name="line.4142"></a>
<span class="sourceLineNo">4143</span>        }<a name="line.4143"></a>
<span class="sourceLineNo">4144</span>    }<a name="line.4144"></a>
<span class="sourceLineNo">4145</span><a name="line.4145"></a>
<span class="sourceLineNo">4146</span>    /**<a name="line.4146"></a>
<span class="sourceLineNo">4147</span>     * Returns the list of domain markers (read only) for the specified layer.<a name="line.4147"></a>
<span class="sourceLineNo">4148</span>     *<a name="line.4148"></a>
<span class="sourceLineNo">4149</span>     * @param layer  the layer (foreground or background).<a name="line.4149"></a>
<span class="sourceLineNo">4150</span>     *<a name="line.4150"></a>
<span class="sourceLineNo">4151</span>     * @return The list of domain markers.<a name="line.4151"></a>
<span class="sourceLineNo">4152</span>     *<a name="line.4152"></a>
<span class="sourceLineNo">4153</span>     * @see #getRangeMarkers(Layer)<a name="line.4153"></a>
<span class="sourceLineNo">4154</span>     */<a name="line.4154"></a>
<span class="sourceLineNo">4155</span>    public Collection getDomainMarkers(Layer layer) {<a name="line.4155"></a>
<span class="sourceLineNo">4156</span>        return getDomainMarkers(0, layer);<a name="line.4156"></a>
<span class="sourceLineNo">4157</span>    }<a name="line.4157"></a>
<span class="sourceLineNo">4158</span><a name="line.4158"></a>
<span class="sourceLineNo">4159</span>    /**<a name="line.4159"></a>
<span class="sourceLineNo">4160</span>     * Returns the list of range markers (read only) for the specified layer.<a name="line.4160"></a>
<span class="sourceLineNo">4161</span>     *<a name="line.4161"></a>
<span class="sourceLineNo">4162</span>     * @param layer  the layer (foreground or background).<a name="line.4162"></a>
<span class="sourceLineNo">4163</span>     *<a name="line.4163"></a>
<span class="sourceLineNo">4164</span>     * @return The list of range markers.<a name="line.4164"></a>
<span class="sourceLineNo">4165</span>     *<a name="line.4165"></a>
<span class="sourceLineNo">4166</span>     * @see #getDomainMarkers(Layer)<a name="line.4166"></a>
<span class="sourceLineNo">4167</span>     */<a name="line.4167"></a>
<span class="sourceLineNo">4168</span>    public Collection getRangeMarkers(Layer layer) {<a name="line.4168"></a>
<span class="sourceLineNo">4169</span>        return getRangeMarkers(0, layer);<a name="line.4169"></a>
<span class="sourceLineNo">4170</span>    }<a name="line.4170"></a>
<span class="sourceLineNo">4171</span><a name="line.4171"></a>
<span class="sourceLineNo">4172</span>    /**<a name="line.4172"></a>
<span class="sourceLineNo">4173</span>     * Returns a collection of domain markers for a particular renderer and<a name="line.4173"></a>
<span class="sourceLineNo">4174</span>     * layer.<a name="line.4174"></a>
<span class="sourceLineNo">4175</span>     *<a name="line.4175"></a>
<span class="sourceLineNo">4176</span>     * @param index  the renderer index.<a name="line.4176"></a>
<span class="sourceLineNo">4177</span>     * @param layer  the layer.<a name="line.4177"></a>
<span class="sourceLineNo">4178</span>     *<a name="line.4178"></a>
<span class="sourceLineNo">4179</span>     * @return A collection of markers (possibly &lt;code&gt;null&lt;/code&gt;).<a name="line.4179"></a>
<span class="sourceLineNo">4180</span>     *<a name="line.4180"></a>
<span class="sourceLineNo">4181</span>     * @see #getRangeMarkers(int, Layer)<a name="line.4181"></a>
<span class="sourceLineNo">4182</span>     */<a name="line.4182"></a>
<span class="sourceLineNo">4183</span>    public Collection getDomainMarkers(int index, Layer layer) {<a name="line.4183"></a>
<span class="sourceLineNo">4184</span>        Collection result = null;<a name="line.4184"></a>
<span class="sourceLineNo">4185</span>        Integer key = new Integer(index);<a name="line.4185"></a>
<span class="sourceLineNo">4186</span>        if (layer == Layer.FOREGROUND) {<a name="line.4186"></a>
<span class="sourceLineNo">4187</span>            result = (Collection) this.foregroundDomainMarkers.get(key);<a name="line.4187"></a>
<span class="sourceLineNo">4188</span>        }<a name="line.4188"></a>
<span class="sourceLineNo">4189</span>        else if (layer == Layer.BACKGROUND) {<a name="line.4189"></a>
<span class="sourceLineNo">4190</span>            result = (Collection) this.backgroundDomainMarkers.get(key);<a name="line.4190"></a>
<span class="sourceLineNo">4191</span>        }<a name="line.4191"></a>
<span class="sourceLineNo">4192</span>        if (result != null) {<a name="line.4192"></a>
<span class="sourceLineNo">4193</span>            result = Collections.unmodifiableCollection(result);<a name="line.4193"></a>
<span class="sourceLineNo">4194</span>        }<a name="line.4194"></a>
<span class="sourceLineNo">4195</span>        return result;<a name="line.4195"></a>
<span class="sourceLineNo">4196</span>    }<a name="line.4196"></a>
<span class="sourceLineNo">4197</span><a name="line.4197"></a>
<span class="sourceLineNo">4198</span>    /**<a name="line.4198"></a>
<span class="sourceLineNo">4199</span>     * Returns a collection of range markers for a particular renderer and<a name="line.4199"></a>
<span class="sourceLineNo">4200</span>     * layer.<a name="line.4200"></a>
<span class="sourceLineNo">4201</span>     *<a name="line.4201"></a>
<span class="sourceLineNo">4202</span>     * @param index  the renderer index.<a name="line.4202"></a>
<span class="sourceLineNo">4203</span>     * @param layer  the layer.<a name="line.4203"></a>
<span class="sourceLineNo">4204</span>     *<a name="line.4204"></a>
<span class="sourceLineNo">4205</span>     * @return A collection of markers (possibly &lt;code&gt;null&lt;/code&gt;).<a name="line.4205"></a>
<span class="sourceLineNo">4206</span>     *<a name="line.4206"></a>
<span class="sourceLineNo">4207</span>     * @see #getDomainMarkers(int, Layer)<a name="line.4207"></a>
<span class="sourceLineNo">4208</span>     */<a name="line.4208"></a>
<span class="sourceLineNo">4209</span>    public Collection getRangeMarkers(int index, Layer layer) {<a name="line.4209"></a>
<span class="sourceLineNo">4210</span>        Collection result = null;<a name="line.4210"></a>
<span class="sourceLineNo">4211</span>        Integer key = new Integer(index);<a name="line.4211"></a>
<span class="sourceLineNo">4212</span>        if (layer == Layer.FOREGROUND) {<a name="line.4212"></a>
<span class="sourceLineNo">4213</span>            result = (Collection) this.foregroundRangeMarkers.get(key);<a name="line.4213"></a>
<span class="sourceLineNo">4214</span>        }<a name="line.4214"></a>
<span class="sourceLineNo">4215</span>        else if (layer == Layer.BACKGROUND) {<a name="line.4215"></a>
<span class="sourceLineNo">4216</span>            result = (Collection) this.backgroundRangeMarkers.get(key);<a name="line.4216"></a>
<span class="sourceLineNo">4217</span>        }<a name="line.4217"></a>
<span class="sourceLineNo">4218</span>        if (result != null) {<a name="line.4218"></a>
<span class="sourceLineNo">4219</span>            result = Collections.unmodifiableCollection(result);<a name="line.4219"></a>
<span class="sourceLineNo">4220</span>        }<a name="line.4220"></a>
<span class="sourceLineNo">4221</span>        return result;<a name="line.4221"></a>
<span class="sourceLineNo">4222</span>    }<a name="line.4222"></a>
<span class="sourceLineNo">4223</span><a name="line.4223"></a>
<span class="sourceLineNo">4224</span>    /**<a name="line.4224"></a>
<span class="sourceLineNo">4225</span>     * Utility method for drawing a horizontal line across the data area of the<a name="line.4225"></a>
<span class="sourceLineNo">4226</span>     * plot.<a name="line.4226"></a>
<span class="sourceLineNo">4227</span>     *<a name="line.4227"></a>
<span class="sourceLineNo">4228</span>     * @param g2  the graphics device.<a name="line.4228"></a>
<span class="sourceLineNo">4229</span>     * @param dataArea  the data area.<a name="line.4229"></a>
<span class="sourceLineNo">4230</span>     * @param value  the coordinate, where to draw the line.<a name="line.4230"></a>
<span class="sourceLineNo">4231</span>     * @param stroke  the stroke to use.<a name="line.4231"></a>
<span class="sourceLineNo">4232</span>     * @param paint  the paint to use.<a name="line.4232"></a>
<span class="sourceLineNo">4233</span>     */<a name="line.4233"></a>
<span class="sourceLineNo">4234</span>    protected void drawHorizontalLine(Graphics2D g2, Rectangle2D dataArea,<a name="line.4234"></a>
<span class="sourceLineNo">4235</span>                                      double value, Stroke stroke,<a name="line.4235"></a>
<span class="sourceLineNo">4236</span>                                      Paint paint) {<a name="line.4236"></a>
<span class="sourceLineNo">4237</span><a name="line.4237"></a>
<span class="sourceLineNo">4238</span>        ValueAxis axis = getRangeAxis();<a name="line.4238"></a>
<span class="sourceLineNo">4239</span>        if (getOrientation() == PlotOrientation.HORIZONTAL) {<a name="line.4239"></a>
<span class="sourceLineNo">4240</span>            axis = getDomainAxis();<a name="line.4240"></a>
<span class="sourceLineNo">4241</span>        }<a name="line.4241"></a>
<span class="sourceLineNo">4242</span>        if (axis.getRange().contains(value)) {<a name="line.4242"></a>
<span class="sourceLineNo">4243</span>            double yy = axis.valueToJava2D(value, dataArea, RectangleEdge.LEFT);<a name="line.4243"></a>
<span class="sourceLineNo">4244</span>            Line2D line = new Line2D.Double(dataArea.getMinX(), yy,<a name="line.4244"></a>
<span class="sourceLineNo">4245</span>                    dataArea.getMaxX(), yy);<a name="line.4245"></a>
<span class="sourceLineNo">4246</span>            g2.setStroke(stroke);<a name="line.4246"></a>
<span class="sourceLineNo">4247</span>            g2.setPaint(paint);<a name="line.4247"></a>
<span class="sourceLineNo">4248</span>            g2.draw(line);<a name="line.4248"></a>
<span class="sourceLineNo">4249</span>        }<a name="line.4249"></a>
<span class="sourceLineNo">4250</span><a name="line.4250"></a>
<span class="sourceLineNo">4251</span>    }<a name="line.4251"></a>
<span class="sourceLineNo">4252</span><a name="line.4252"></a>
<span class="sourceLineNo">4253</span>    /**<a name="line.4253"></a>
<span class="sourceLineNo">4254</span>     * Draws a domain crosshair.<a name="line.4254"></a>
<span class="sourceLineNo">4255</span>     *<a name="line.4255"></a>
<span class="sourceLineNo">4256</span>     * @param g2  the graphics target.<a name="line.4256"></a>
<span class="sourceLineNo">4257</span>     * @param dataArea  the data area.<a name="line.4257"></a>
<span class="sourceLineNo">4258</span>     * @param orientation  the plot orientation.<a name="line.4258"></a>
<span class="sourceLineNo">4259</span>     * @param value  the crosshair value.<a name="line.4259"></a>
<span class="sourceLineNo">4260</span>     * @param axis  the axis against which the value is measured.<a name="line.4260"></a>
<span class="sourceLineNo">4261</span>     * @param stroke  the stroke used to draw the crosshair line.<a name="line.4261"></a>
<span class="sourceLineNo">4262</span>     * @param paint  the paint used to draw the crosshair line.<a name="line.4262"></a>
<span class="sourceLineNo">4263</span>     *<a name="line.4263"></a>
<span class="sourceLineNo">4264</span>     * @since 1.0.4<a name="line.4264"></a>
<span class="sourceLineNo">4265</span>     */<a name="line.4265"></a>
<span class="sourceLineNo">4266</span>    protected void drawDomainCrosshair(Graphics2D g2, Rectangle2D dataArea,<a name="line.4266"></a>
<span class="sourceLineNo">4267</span>            PlotOrientation orientation, double value, ValueAxis axis,<a name="line.4267"></a>
<span class="sourceLineNo">4268</span>            Stroke stroke, Paint paint) {<a name="line.4268"></a>
<span class="sourceLineNo">4269</span><a name="line.4269"></a>
<span class="sourceLineNo">4270</span>        if (axis.getRange().contains(value)) {<a name="line.4270"></a>
<span class="sourceLineNo">4271</span>            Line2D line = null;<a name="line.4271"></a>
<span class="sourceLineNo">4272</span>            if (orientation == PlotOrientation.VERTICAL) {<a name="line.4272"></a>
<span class="sourceLineNo">4273</span>                double xx = axis.valueToJava2D(value, dataArea,<a name="line.4273"></a>
<span class="sourceLineNo">4274</span>                        RectangleEdge.BOTTOM);<a name="line.4274"></a>
<span class="sourceLineNo">4275</span>                line = new Line2D.Double(xx, dataArea.getMinY(), xx,<a name="line.4275"></a>
<span class="sourceLineNo">4276</span>                        dataArea.getMaxY());<a name="line.4276"></a>
<span class="sourceLineNo">4277</span>            }<a name="line.4277"></a>
<span class="sourceLineNo">4278</span>            else {<a name="line.4278"></a>
<span class="sourceLineNo">4279</span>                double yy = axis.valueToJava2D(value, dataArea,<a name="line.4279"></a>
<span class="sourceLineNo">4280</span>                        RectangleEdge.LEFT);<a name="line.4280"></a>
<span class="sourceLineNo">4281</span>                line = new Line2D.Double(dataArea.getMinX(), yy,<a name="line.4281"></a>
<span class="sourceLineNo">4282</span>                        dataArea.getMaxX(), yy);<a name="line.4282"></a>
<span class="sourceLineNo">4283</span>            }<a name="line.4283"></a>
<span class="sourceLineNo">4284</span>            g2.setStroke(stroke);<a name="line.4284"></a>
<span class="sourceLineNo">4285</span>            g2.setPaint(paint);<a name="line.4285"></a>
<span class="sourceLineNo">4286</span>            g2.draw(line);<a name="line.4286"></a>
<span class="sourceLineNo">4287</span>        }<a name="line.4287"></a>
<span class="sourceLineNo">4288</span><a name="line.4288"></a>
<span class="sourceLineNo">4289</span>    }<a name="line.4289"></a>
<span class="sourceLineNo">4290</span><a name="line.4290"></a>
<span class="sourceLineNo">4291</span>    /**<a name="line.4291"></a>
<span class="sourceLineNo">4292</span>     * Utility method for drawing a vertical line on the data area of the plot.<a name="line.4292"></a>
<span class="sourceLineNo">4293</span>     *<a name="line.4293"></a>
<span class="sourceLineNo">4294</span>     * @param g2  the graphics device.<a name="line.4294"></a>
<span class="sourceLineNo">4295</span>     * @param dataArea  the data area.<a name="line.4295"></a>
<span class="sourceLineNo">4296</span>     * @param value  the coordinate, where to draw the line.<a name="line.4296"></a>
<span class="sourceLineNo">4297</span>     * @param stroke  the stroke to use.<a name="line.4297"></a>
<span class="sourceLineNo">4298</span>     * @param paint  the paint to use.<a name="line.4298"></a>
<span class="sourceLineNo">4299</span>     */<a name="line.4299"></a>
<span class="sourceLineNo">4300</span>    protected void drawVerticalLine(Graphics2D g2, Rectangle2D dataArea,<a name="line.4300"></a>
<span class="sourceLineNo">4301</span>                                    double value, Stroke stroke, Paint paint) {<a name="line.4301"></a>
<span class="sourceLineNo">4302</span><a name="line.4302"></a>
<span class="sourceLineNo">4303</span>        ValueAxis axis = getDomainAxis();<a name="line.4303"></a>
<span class="sourceLineNo">4304</span>        if (getOrientation() == PlotOrientation.HORIZONTAL) {<a name="line.4304"></a>
<span class="sourceLineNo">4305</span>            axis = getRangeAxis();<a name="line.4305"></a>
<span class="sourceLineNo">4306</span>        }<a name="line.4306"></a>
<span class="sourceLineNo">4307</span>        if (axis.getRange().contains(value)) {<a name="line.4307"></a>
<span class="sourceLineNo">4308</span>            double xx = axis.valueToJava2D(value, dataArea,<a name="line.4308"></a>
<span class="sourceLineNo">4309</span>                    RectangleEdge.BOTTOM);<a name="line.4309"></a>
<span class="sourceLineNo">4310</span>            Line2D line = new Line2D.Double(xx, dataArea.getMinY(), xx,<a name="line.4310"></a>
<span class="sourceLineNo">4311</span>                    dataArea.getMaxY());<a name="line.4311"></a>
<span class="sourceLineNo">4312</span>            g2.setStroke(stroke);<a name="line.4312"></a>
<span class="sourceLineNo">4313</span>            g2.setPaint(paint);<a name="line.4313"></a>
<span class="sourceLineNo">4314</span>            g2.draw(line);<a name="line.4314"></a>
<span class="sourceLineNo">4315</span>        }<a name="line.4315"></a>
<span class="sourceLineNo">4316</span><a name="line.4316"></a>
<span class="sourceLineNo">4317</span>    }<a name="line.4317"></a>
<span class="sourceLineNo">4318</span><a name="line.4318"></a>
<span class="sourceLineNo">4319</span>    /**<a name="line.4319"></a>
<span class="sourceLineNo">4320</span>     * Draws a range crosshair.<a name="line.4320"></a>
<span class="sourceLineNo">4321</span>     *<a name="line.4321"></a>
<span class="sourceLineNo">4322</span>     * @param g2  the graphics target.<a name="line.4322"></a>
<span class="sourceLineNo">4323</span>     * @param dataArea  the data area.<a name="line.4323"></a>
<span class="sourceLineNo">4324</span>     * @param orientation  the plot orientation.<a name="line.4324"></a>
<span class="sourceLineNo">4325</span>     * @param value  the crosshair value.<a name="line.4325"></a>
<span class="sourceLineNo">4326</span>     * @param axis  the axis against which the value is measured.<a name="line.4326"></a>
<span class="sourceLineNo">4327</span>     * @param stroke  the stroke used to draw the crosshair line.<a name="line.4327"></a>
<span class="sourceLineNo">4328</span>     * @param paint  the paint used to draw the crosshair line.<a name="line.4328"></a>
<span class="sourceLineNo">4329</span>     *<a name="line.4329"></a>
<span class="sourceLineNo">4330</span>     * @since 1.0.4<a name="line.4330"></a>
<span class="sourceLineNo">4331</span>     */<a name="line.4331"></a>
<span class="sourceLineNo">4332</span>    protected void drawRangeCrosshair(Graphics2D g2, Rectangle2D dataArea,<a name="line.4332"></a>
<span class="sourceLineNo">4333</span>            PlotOrientation orientation, double value, ValueAxis axis,<a name="line.4333"></a>
<span class="sourceLineNo">4334</span>            Stroke stroke, Paint paint) {<a name="line.4334"></a>
<span class="sourceLineNo">4335</span><a name="line.4335"></a>
<span class="sourceLineNo">4336</span>        if (axis.getRange().contains(value)) {<a name="line.4336"></a>
<span class="sourceLineNo">4337</span>            Line2D line = null;<a name="line.4337"></a>
<span class="sourceLineNo">4338</span>            if (orientation == PlotOrientation.HORIZONTAL) {<a name="line.4338"></a>
<span class="sourceLineNo">4339</span>                double xx = axis.valueToJava2D(value, dataArea,<a name="line.4339"></a>
<span class="sourceLineNo">4340</span>                        RectangleEdge.BOTTOM);<a name="line.4340"></a>
<span class="sourceLineNo">4341</span>                line = new Line2D.Double(xx, dataArea.getMinY(), xx,<a name="line.4341"></a>
<span class="sourceLineNo">4342</span>                        dataArea.getMaxY());<a name="line.4342"></a>
<span class="sourceLineNo">4343</span>            }<a name="line.4343"></a>
<span class="sourceLineNo">4344</span>            else {<a name="line.4344"></a>
<span class="sourceLineNo">4345</span>                double yy = axis.valueToJava2D(value, dataArea,<a name="line.4345"></a>
<span class="sourceLineNo">4346</span>                        RectangleEdge.LEFT);<a name="line.4346"></a>
<span class="sourceLineNo">4347</span>                line = new Line2D.Double(dataArea.getMinX(), yy,<a name="line.4347"></a>
<span class="sourceLineNo">4348</span>                        dataArea.getMaxX(), yy);<a name="line.4348"></a>
<span class="sourceLineNo">4349</span>            }<a name="line.4349"></a>
<span class="sourceLineNo">4350</span>            g2.setStroke(stroke);<a name="line.4350"></a>
<span class="sourceLineNo">4351</span>            g2.setPaint(paint);<a name="line.4351"></a>
<span class="sourceLineNo">4352</span>            g2.draw(line);<a name="line.4352"></a>
<span class="sourceLineNo">4353</span>        }<a name="line.4353"></a>
<span class="sourceLineNo">4354</span><a name="line.4354"></a>
<span class="sourceLineNo">4355</span>    }<a name="line.4355"></a>
<span class="sourceLineNo">4356</span><a name="line.4356"></a>
<span class="sourceLineNo">4357</span>    /**<a name="line.4357"></a>
<span class="sourceLineNo">4358</span>     * Handles a 'click' on the plot by updating the anchor values.<a name="line.4358"></a>
<span class="sourceLineNo">4359</span>     *<a name="line.4359"></a>
<span class="sourceLineNo">4360</span>     * @param x  the x-coordinate, where the click occurred, in Java2D space.<a name="line.4360"></a>
<span class="sourceLineNo">4361</span>     * @param y  the y-coordinate, where the click occurred, in Java2D space.<a name="line.4361"></a>
<span class="sourceLineNo">4362</span>     * @param info  object containing information about the plot dimensions.<a name="line.4362"></a>
<span class="sourceLineNo">4363</span>     */<a name="line.4363"></a>
<span class="sourceLineNo">4364</span>    public void handleClick(int x, int y, PlotRenderingInfo info) {<a name="line.4364"></a>
<span class="sourceLineNo">4365</span><a name="line.4365"></a>
<span class="sourceLineNo">4366</span>        Rectangle2D dataArea = info.getDataArea();<a name="line.4366"></a>
<span class="sourceLineNo">4367</span>        if (dataArea.contains(x, y)) {<a name="line.4367"></a>
<span class="sourceLineNo">4368</span>            // set the anchor value for the horizontal axis...<a name="line.4368"></a>
<span class="sourceLineNo">4369</span>            ValueAxis xaxis = getDomainAxis();<a name="line.4369"></a>
<span class="sourceLineNo">4370</span>            if (xaxis != null) {<a name="line.4370"></a>
<span class="sourceLineNo">4371</span>                double hvalue = xaxis.java2DToValue(x, info.getDataArea(),<a name="line.4371"></a>
<span class="sourceLineNo">4372</span>                        getDomainAxisEdge());<a name="line.4372"></a>
<span class="sourceLineNo">4373</span>                setDomainCrosshairValue(hvalue);<a name="line.4373"></a>
<span class="sourceLineNo">4374</span>            }<a name="line.4374"></a>
<span class="sourceLineNo">4375</span><a name="line.4375"></a>
<span class="sourceLineNo">4376</span>            // set the anchor value for the vertical axis...<a name="line.4376"></a>
<span class="sourceLineNo">4377</span>            ValueAxis yaxis = getRangeAxis();<a name="line.4377"></a>
<span class="sourceLineNo">4378</span>            if (yaxis != null) {<a name="line.4378"></a>
<span class="sourceLineNo">4379</span>                double vvalue = yaxis.java2DToValue(y, info.getDataArea(),<a name="line.4379"></a>
<span class="sourceLineNo">4380</span>                        getRangeAxisEdge());<a name="line.4380"></a>
<span class="sourceLineNo">4381</span>                setRangeCrosshairValue(vvalue);<a name="line.4381"></a>
<span class="sourceLineNo">4382</span>            }<a name="line.4382"></a>
<span class="sourceLineNo">4383</span>        }<a name="line.4383"></a>
<span class="sourceLineNo">4384</span>    }<a name="line.4384"></a>
<span class="sourceLineNo">4385</span><a name="line.4385"></a>
<span class="sourceLineNo">4386</span>    /**<a name="line.4386"></a>
<span class="sourceLineNo">4387</span>     * A utility method that returns a list of datasets that are mapped to a<a name="line.4387"></a>
<span class="sourceLineNo">4388</span>     * particular axis.<a name="line.4388"></a>
<span class="sourceLineNo">4389</span>     *<a name="line.4389"></a>
<span class="sourceLineNo">4390</span>     * @param axisIndex  the axis index (&lt;code&gt;null&lt;/code&gt; not permitted).<a name="line.4390"></a>
<span class="sourceLineNo">4391</span>     *<a name="line.4391"></a>
<span class="sourceLineNo">4392</span>     * @return A list of datasets.<a name="line.4392"></a>
<span class="sourceLineNo">4393</span>     */<a name="line.4393"></a>
<span class="sourceLineNo">4394</span>    private List getDatasetsMappedToDomainAxis(Integer axisIndex) {<a name="line.4394"></a>
<span class="sourceLineNo">4395</span>        if (axisIndex == null) {<a name="line.4395"></a>
<span class="sourceLineNo">4396</span>            throw new IllegalArgumentException("Null 'axisIndex' argument.");<a name="line.4396"></a>
<span class="sourceLineNo">4397</span>        }<a name="line.4397"></a>
<span class="sourceLineNo">4398</span>        List result = new ArrayList();<a name="line.4398"></a>
<span class="sourceLineNo">4399</span>        for (int i = 0; i &lt; this.datasets.size(); i++) {<a name="line.4399"></a>
<span class="sourceLineNo">4400</span>            List mappedAxes = (List) this.datasetToDomainAxesMap.get(<a name="line.4400"></a>
<span class="sourceLineNo">4401</span>                    new Integer(i));<a name="line.4401"></a>
<span class="sourceLineNo">4402</span>            if (mappedAxes == null) {<a name="line.4402"></a>
<span class="sourceLineNo">4403</span>                if (axisIndex.equals(ZERO)) {<a name="line.4403"></a>
<span class="sourceLineNo">4404</span>                    result.add(this.datasets.get(i));<a name="line.4404"></a>
<span class="sourceLineNo">4405</span>                }<a name="line.4405"></a>
<span class="sourceLineNo">4406</span>            }<a name="line.4406"></a>
<span class="sourceLineNo">4407</span>            else {<a name="line.4407"></a>
<span class="sourceLineNo">4408</span>                if (mappedAxes.contains(axisIndex)) {<a name="line.4408"></a>
<span class="sourceLineNo">4409</span>                    result.add(this.datasets.get(i));<a name="line.4409"></a>
<span class="sourceLineNo">4410</span>                }<a name="line.4410"></a>
<span class="sourceLineNo">4411</span>            }<a name="line.4411"></a>
<span class="sourceLineNo">4412</span>        }<a name="line.4412"></a>
<span class="sourceLineNo">4413</span>        return result;<a name="line.4413"></a>
<span class="sourceLineNo">4414</span>    }<a name="line.4414"></a>
<span class="sourceLineNo">4415</span><a name="line.4415"></a>
<span class="sourceLineNo">4416</span>    /**<a name="line.4416"></a>
<span class="sourceLineNo">4417</span>     * A utility method that returns a list of datasets that are mapped to a<a name="line.4417"></a>
<span class="sourceLineNo">4418</span>     * particular axis.<a name="line.4418"></a>
<span class="sourceLineNo">4419</span>     *<a name="line.4419"></a>
<span class="sourceLineNo">4420</span>     * @param axisIndex  the axis index (&lt;code&gt;null&lt;/code&gt; not permitted).<a name="line.4420"></a>
<span class="sourceLineNo">4421</span>     *<a name="line.4421"></a>
<span class="sourceLineNo">4422</span>     * @return A list of datasets.<a name="line.4422"></a>
<span class="sourceLineNo">4423</span>     */<a name="line.4423"></a>
<span class="sourceLineNo">4424</span>    private List getDatasetsMappedToRangeAxis(Integer axisIndex) {<a name="line.4424"></a>
<span class="sourceLineNo">4425</span>        if (axisIndex == null) {<a name="line.4425"></a>
<span class="sourceLineNo">4426</span>            throw new IllegalArgumentException("Null 'axisIndex' argument.");<a name="line.4426"></a>
<span class="sourceLineNo">4427</span>        }<a name="line.4427"></a>
<span class="sourceLineNo">4428</span>        List result = new ArrayList();<a name="line.4428"></a>
<span class="sourceLineNo">4429</span>        for (int i = 0; i &lt; this.datasets.size(); i++) {<a name="line.4429"></a>
<span class="sourceLineNo">4430</span>            List mappedAxes = (List) this.datasetToRangeAxesMap.get(<a name="line.4430"></a>
<span class="sourceLineNo">4431</span>                    new Integer(i));<a name="line.4431"></a>
<span class="sourceLineNo">4432</span>            if (mappedAxes == null) {<a name="line.4432"></a>
<span class="sourceLineNo">4433</span>                if (axisIndex.equals(ZERO)) {<a name="line.4433"></a>
<span class="sourceLineNo">4434</span>                    result.add(this.datasets.get(i));<a name="line.4434"></a>
<span class="sourceLineNo">4435</span>                }<a name="line.4435"></a>
<span class="sourceLineNo">4436</span>            }<a name="line.4436"></a>
<span class="sourceLineNo">4437</span>            else {<a name="line.4437"></a>
<span class="sourceLineNo">4438</span>                if (mappedAxes.contains(axisIndex)) {<a name="line.4438"></a>
<span class="sourceLineNo">4439</span>                    result.add(this.datasets.get(i));<a name="line.4439"></a>
<span class="sourceLineNo">4440</span>                }<a name="line.4440"></a>
<span class="sourceLineNo">4441</span>            }<a name="line.4441"></a>
<span class="sourceLineNo">4442</span>        }<a name="line.4442"></a>
<span class="sourceLineNo">4443</span>        return result;<a name="line.4443"></a>
<span class="sourceLineNo">4444</span>    }<a name="line.4444"></a>
<span class="sourceLineNo">4445</span><a name="line.4445"></a>
<span class="sourceLineNo">4446</span>    /**<a name="line.4446"></a>
<span class="sourceLineNo">4447</span>     * Returns the index of the given domain axis.<a name="line.4447"></a>
<span class="sourceLineNo">4448</span>     *<a name="line.4448"></a>
<span class="sourceLineNo">4449</span>     * @param axis  the axis.<a name="line.4449"></a>
<span class="sourceLineNo">4450</span>     *<a name="line.4450"></a>
<span class="sourceLineNo">4451</span>     * @return The axis index.<a name="line.4451"></a>
<span class="sourceLineNo">4452</span>     *<a name="line.4452"></a>
<span class="sourceLineNo">4453</span>     * @see #getRangeAxisIndex(ValueAxis)<a name="line.4453"></a>
<span class="sourceLineNo">4454</span>     */<a name="line.4454"></a>
<span class="sourceLineNo">4455</span>    public int getDomainAxisIndex(ValueAxis axis) {<a name="line.4455"></a>
<span class="sourceLineNo">4456</span>        int result = this.domainAxes.indexOf(axis);<a name="line.4456"></a>
<span class="sourceLineNo">4457</span>        if (result &lt; 0) {<a name="line.4457"></a>
<span class="sourceLineNo">4458</span>            // try the parent plot<a name="line.4458"></a>
<span class="sourceLineNo">4459</span>            Plot parent = getParent();<a name="line.4459"></a>
<span class="sourceLineNo">4460</span>            if (parent instanceof XYPlot) {<a name="line.4460"></a>
<span class="sourceLineNo">4461</span>                XYPlot p = (XYPlot) parent;<a name="line.4461"></a>
<span class="sourceLineNo">4462</span>                result = p.getDomainAxisIndex(axis);<a name="line.4462"></a>
<span class="sourceLineNo">4463</span>            }<a name="line.4463"></a>
<span class="sourceLineNo">4464</span>        }<a name="line.4464"></a>
<span class="sourceLineNo">4465</span>        return result;<a name="line.4465"></a>
<span class="sourceLineNo">4466</span>    }<a name="line.4466"></a>
<span class="sourceLineNo">4467</span><a name="line.4467"></a>
<span class="sourceLineNo">4468</span>    /**<a name="line.4468"></a>
<span class="sourceLineNo">4469</span>     * Returns the index of the given range axis.<a name="line.4469"></a>
<span class="sourceLineNo">4470</span>     *<a name="line.4470"></a>
<span class="sourceLineNo">4471</span>     * @param axis  the axis.<a name="line.4471"></a>
<span class="sourceLineNo">4472</span>     *<a name="line.4472"></a>
<span class="sourceLineNo">4473</span>     * @return The axis index.<a name="line.4473"></a>
<span class="sourceLineNo">4474</span>     *<a name="line.4474"></a>
<span class="sourceLineNo">4475</span>     * @see #getDomainAxisIndex(ValueAxis)<a name="line.4475"></a>
<span class="sourceLineNo">4476</span>     */<a name="line.4476"></a>
<span class="sourceLineNo">4477</span>    public int getRangeAxisIndex(ValueAxis axis) {<a name="line.4477"></a>
<span class="sourceLineNo">4478</span>        int result = this.rangeAxes.indexOf(axis);<a name="line.4478"></a>
<span class="sourceLineNo">4479</span>        if (result &lt; 0) {<a name="line.4479"></a>
<span class="sourceLineNo">4480</span>            // try the parent plot<a name="line.4480"></a>
<span class="sourceLineNo">4481</span>            Plot parent = getParent();<a name="line.4481"></a>
<span class="sourceLineNo">4482</span>            if (parent instanceof XYPlot) {<a name="line.4482"></a>
<span class="sourceLineNo">4483</span>                XYPlot p = (XYPlot) parent;<a name="line.4483"></a>
<span class="sourceLineNo">4484</span>                result = p.getRangeAxisIndex(axis);<a name="line.4484"></a>
<span class="sourceLineNo">4485</span>            }<a name="line.4485"></a>
<span class="sourceLineNo">4486</span>        }<a name="line.4486"></a>
<span class="sourceLineNo">4487</span>        return result;<a name="line.4487"></a>
<span class="sourceLineNo">4488</span>    }<a name="line.4488"></a>
<span class="sourceLineNo">4489</span><a name="line.4489"></a>
<span class="sourceLineNo">4490</span>    /**<a name="line.4490"></a>
<span class="sourceLineNo">4491</span>     * Returns the range for the specified axis.<a name="line.4491"></a>
<span class="sourceLineNo">4492</span>     *<a name="line.4492"></a>
<span class="sourceLineNo">4493</span>     * @param axis  the axis.<a name="line.4493"></a>
<span class="sourceLineNo">4494</span>     *<a name="line.4494"></a>
<span class="sourceLineNo">4495</span>     * @return The range.<a name="line.4495"></a>
<span class="sourceLineNo">4496</span>     */<a name="line.4496"></a>
<span class="sourceLineNo">4497</span>    public Range getDataRange(ValueAxis axis) {<a name="line.4497"></a>
<span class="sourceLineNo">4498</span><a name="line.4498"></a>
<span class="sourceLineNo">4499</span>        Range result = null;<a name="line.4499"></a>
<span class="sourceLineNo">4500</span>        List mappedDatasets = new ArrayList();<a name="line.4500"></a>
<span class="sourceLineNo">4501</span>        List includedAnnotations = new ArrayList();<a name="line.4501"></a>
<span class="sourceLineNo">4502</span>        boolean isDomainAxis = true;<a name="line.4502"></a>
<span class="sourceLineNo">4503</span><a name="line.4503"></a>
<span class="sourceLineNo">4504</span>        // is it a domain axis?<a name="line.4504"></a>
<span class="sourceLineNo">4505</span>        int domainIndex = getDomainAxisIndex(axis);<a name="line.4505"></a>
<span class="sourceLineNo">4506</span>        if (domainIndex &gt;= 0) {<a name="line.4506"></a>
<span class="sourceLineNo">4507</span>            isDomainAxis = true;<a name="line.4507"></a>
<span class="sourceLineNo">4508</span>            mappedDatasets.addAll(getDatasetsMappedToDomainAxis(<a name="line.4508"></a>
<span class="sourceLineNo">4509</span>                    new Integer(domainIndex)));<a name="line.4509"></a>
<span class="sourceLineNo">4510</span>            if (domainIndex == 0) {<a name="line.4510"></a>
<span class="sourceLineNo">4511</span>                // grab the plot's annotations<a name="line.4511"></a>
<span class="sourceLineNo">4512</span>                Iterator iterator = this.annotations.iterator();<a name="line.4512"></a>
<span class="sourceLineNo">4513</span>                while (iterator.hasNext()) {<a name="line.4513"></a>
<span class="sourceLineNo">4514</span>                    XYAnnotation annotation = (XYAnnotation) iterator.next();<a name="line.4514"></a>
<span class="sourceLineNo">4515</span>                    if (annotation instanceof XYAnnotationBoundsInfo) {<a name="line.4515"></a>
<span class="sourceLineNo">4516</span>                        includedAnnotations.add(annotation);<a name="line.4516"></a>
<span class="sourceLineNo">4517</span>                    }<a name="line.4517"></a>
<span class="sourceLineNo">4518</span>                }<a name="line.4518"></a>
<span class="sourceLineNo">4519</span>            }<a name="line.4519"></a>
<span class="sourceLineNo">4520</span>        }<a name="line.4520"></a>
<span class="sourceLineNo">4521</span><a name="line.4521"></a>
<span class="sourceLineNo">4522</span>        // or is it a range axis?<a name="line.4522"></a>
<span class="sourceLineNo">4523</span>        int rangeIndex = getRangeAxisIndex(axis);<a name="line.4523"></a>
<span class="sourceLineNo">4524</span>        if (rangeIndex &gt;= 0) {<a name="line.4524"></a>
<span class="sourceLineNo">4525</span>            isDomainAxis = false;<a name="line.4525"></a>
<span class="sourceLineNo">4526</span>            mappedDatasets.addAll(getDatasetsMappedToRangeAxis(<a name="line.4526"></a>
<span class="sourceLineNo">4527</span>                    new Integer(rangeIndex)));<a name="line.4527"></a>
<span class="sourceLineNo">4528</span>            if (rangeIndex == 0) {<a name="line.4528"></a>
<span class="sourceLineNo">4529</span>                Iterator iterator = this.annotations.iterator();<a name="line.4529"></a>
<span class="sourceLineNo">4530</span>                while (iterator.hasNext()) {<a name="line.4530"></a>
<span class="sourceLineNo">4531</span>                    XYAnnotation annotation = (XYAnnotation) iterator.next();<a name="line.4531"></a>
<span class="sourceLineNo">4532</span>                    if (annotation instanceof XYAnnotationBoundsInfo) {<a name="line.4532"></a>
<span class="sourceLineNo">4533</span>                        includedAnnotations.add(annotation);<a name="line.4533"></a>
<span class="sourceLineNo">4534</span>                    }<a name="line.4534"></a>
<span class="sourceLineNo">4535</span>                }<a name="line.4535"></a>
<span class="sourceLineNo">4536</span>            }<a name="line.4536"></a>
<span class="sourceLineNo">4537</span>        }<a name="line.4537"></a>
<span class="sourceLineNo">4538</span><a name="line.4538"></a>
<span class="sourceLineNo">4539</span>        // iterate through the datasets that map to the axis and get the union<a name="line.4539"></a>
<span class="sourceLineNo">4540</span>        // of the ranges.<a name="line.4540"></a>
<span class="sourceLineNo">4541</span>        Iterator iterator = mappedDatasets.iterator();<a name="line.4541"></a>
<span class="sourceLineNo">4542</span>        while (iterator.hasNext()) {<a name="line.4542"></a>
<span class="sourceLineNo">4543</span>            XYDataset d = (XYDataset) iterator.next();<a name="line.4543"></a>
<span class="sourceLineNo">4544</span>            if (d != null) {<a name="line.4544"></a>
<span class="sourceLineNo">4545</span>                XYItemRenderer r = getRendererForDataset(d);<a name="line.4545"></a>
<span class="sourceLineNo">4546</span>                if (isDomainAxis) {<a name="line.4546"></a>
<span class="sourceLineNo">4547</span>                    if (r != null) {<a name="line.4547"></a>
<span class="sourceLineNo">4548</span>                        result = Range.combine(result, r.findDomainBounds(d));<a name="line.4548"></a>
<span class="sourceLineNo">4549</span>                    }<a name="line.4549"></a>
<span class="sourceLineNo">4550</span>                    else {<a name="line.4550"></a>
<span class="sourceLineNo">4551</span>                        result = Range.combine(result,<a name="line.4551"></a>
<span class="sourceLineNo">4552</span>                                DatasetUtilities.findDomainBounds(d));<a name="line.4552"></a>
<span class="sourceLineNo">4553</span>                    }<a name="line.4553"></a>
<span class="sourceLineNo">4554</span>                }<a name="line.4554"></a>
<span class="sourceLineNo">4555</span>                else {<a name="line.4555"></a>
<span class="sourceLineNo">4556</span>                    if (r != null) {<a name="line.4556"></a>
<span class="sourceLineNo">4557</span>                        result = Range.combine(result, r.findRangeBounds(d));<a name="line.4557"></a>
<span class="sourceLineNo">4558</span>                    }<a name="line.4558"></a>
<span class="sourceLineNo">4559</span>                    else {<a name="line.4559"></a>
<span class="sourceLineNo">4560</span>                        result = Range.combine(result,<a name="line.4560"></a>
<span class="sourceLineNo">4561</span>                                DatasetUtilities.findRangeBounds(d));<a name="line.4561"></a>
<span class="sourceLineNo">4562</span>                    }<a name="line.4562"></a>
<span class="sourceLineNo">4563</span>                }<a name="line.4563"></a>
<span class="sourceLineNo">4564</span>                // FIXME: the XYItemRenderer interface doesn't specify the<a name="line.4564"></a>
<span class="sourceLineNo">4565</span>                // getAnnotations() method but it should<a name="line.4565"></a>
<span class="sourceLineNo">4566</span>                if (r instanceof AbstractXYItemRenderer) {<a name="line.4566"></a>
<span class="sourceLineNo">4567</span>                    AbstractXYItemRenderer rr = (AbstractXYItemRenderer) r;<a name="line.4567"></a>
<span class="sourceLineNo">4568</span>                    Collection c = rr.getAnnotations();<a name="line.4568"></a>
<span class="sourceLineNo">4569</span>                    Iterator i = c.iterator();<a name="line.4569"></a>
<span class="sourceLineNo">4570</span>                    while (i.hasNext()) {<a name="line.4570"></a>
<span class="sourceLineNo">4571</span>                        XYAnnotation a = (XYAnnotation) i.next();<a name="line.4571"></a>
<span class="sourceLineNo">4572</span>                        if (a instanceof XYAnnotationBoundsInfo) {<a name="line.4572"></a>
<span class="sourceLineNo">4573</span>                            includedAnnotations.add(a);<a name="line.4573"></a>
<span class="sourceLineNo">4574</span>                        }<a name="line.4574"></a>
<span class="sourceLineNo">4575</span>                    }<a name="line.4575"></a>
<span class="sourceLineNo">4576</span>                }<a name="line.4576"></a>
<span class="sourceLineNo">4577</span>            }<a name="line.4577"></a>
<span class="sourceLineNo">4578</span>        }<a name="line.4578"></a>
<span class="sourceLineNo">4579</span><a name="line.4579"></a>
<span class="sourceLineNo">4580</span>        Iterator it = includedAnnotations.iterator();<a name="line.4580"></a>
<span class="sourceLineNo">4581</span>        while (it.hasNext()) {<a name="line.4581"></a>
<span class="sourceLineNo">4582</span>            XYAnnotationBoundsInfo xyabi = (XYAnnotationBoundsInfo) it.next();<a name="line.4582"></a>
<span class="sourceLineNo">4583</span>            if (xyabi.getIncludeInDataBounds()) {<a name="line.4583"></a>
<span class="sourceLineNo">4584</span>                if (isDomainAxis) {<a name="line.4584"></a>
<span class="sourceLineNo">4585</span>                    result = Range.combine(result, xyabi.getXRange());<a name="line.4585"></a>
<span class="sourceLineNo">4586</span>                }<a name="line.4586"></a>
<span class="sourceLineNo">4587</span>                else {<a name="line.4587"></a>
<span class="sourceLineNo">4588</span>                    result = Range.combine(result, xyabi.getYRange());<a name="line.4588"></a>
<span class="sourceLineNo">4589</span>                }<a name="line.4589"></a>
<span class="sourceLineNo">4590</span>            }<a name="line.4590"></a>
<span class="sourceLineNo">4591</span>        }<a name="line.4591"></a>
<span class="sourceLineNo">4592</span><a name="line.4592"></a>
<span class="sourceLineNo">4593</span>        return result;<a name="line.4593"></a>
<span class="sourceLineNo">4594</span><a name="line.4594"></a>
<span class="sourceLineNo">4595</span>    }<a name="line.4595"></a>
<span class="sourceLineNo">4596</span><a name="line.4596"></a>
<span class="sourceLineNo">4597</span>    /**<a name="line.4597"></a>
<span class="sourceLineNo">4598</span>     * Receives notification of a change to an {@link Annotation} added to<a name="line.4598"></a>
<span class="sourceLineNo">4599</span>     * this plot.<a name="line.4599"></a>
<span class="sourceLineNo">4600</span>     *<a name="line.4600"></a>
<span class="sourceLineNo">4601</span>     * @param event  information about the event (not used here).<a name="line.4601"></a>
<span class="sourceLineNo">4602</span>     *<a name="line.4602"></a>
<span class="sourceLineNo">4603</span>     * @since 1.0.14<a name="line.4603"></a>
<span class="sourceLineNo">4604</span>     */<a name="line.4604"></a>
<span class="sourceLineNo">4605</span>    public void annotationChanged(AnnotationChangeEvent event) {<a name="line.4605"></a>
<span class="sourceLineNo">4606</span>        if (getParent() != null) {<a name="line.4606"></a>
<span class="sourceLineNo">4607</span>            getParent().annotationChanged(event);<a name="line.4607"></a>
<span class="sourceLineNo">4608</span>        }<a name="line.4608"></a>
<span class="sourceLineNo">4609</span>        else {<a name="line.4609"></a>
<span class="sourceLineNo">4610</span>            PlotChangeEvent e = new PlotChangeEvent(this);<a name="line.4610"></a>
<span class="sourceLineNo">4611</span>            notifyListeners(e);<a name="line.4611"></a>
<span class="sourceLineNo">4612</span>        }<a name="line.4612"></a>
<span class="sourceLineNo">4613</span>    }<a name="line.4613"></a>
<span class="sourceLineNo">4614</span><a name="line.4614"></a>
<span class="sourceLineNo">4615</span>    /**<a name="line.4615"></a>
<span class="sourceLineNo">4616</span>     * Receives notification of a change to the plot's dataset.<a name="line.4616"></a>
<span class="sourceLineNo">4617</span>     * &lt;P&gt;<a name="line.4617"></a>
<span class="sourceLineNo">4618</span>     * The axis ranges are updated if necessary.<a name="line.4618"></a>
<span class="sourceLineNo">4619</span>     *<a name="line.4619"></a>
<span class="sourceLineNo">4620</span>     * @param event  information about the event (not used here).<a name="line.4620"></a>
<span class="sourceLineNo">4621</span>     */<a name="line.4621"></a>
<span class="sourceLineNo">4622</span>    public void datasetChanged(DatasetChangeEvent event) {<a name="line.4622"></a>
<span class="sourceLineNo">4623</span>        configureDomainAxes();<a name="line.4623"></a>
<span class="sourceLineNo">4624</span>        configureRangeAxes();<a name="line.4624"></a>
<span class="sourceLineNo">4625</span>        if (getParent() != null) {<a name="line.4625"></a>
<span class="sourceLineNo">4626</span>            getParent().datasetChanged(event);<a name="line.4626"></a>
<span class="sourceLineNo">4627</span>        }<a name="line.4627"></a>
<span class="sourceLineNo">4628</span>        else {<a name="line.4628"></a>
<span class="sourceLineNo">4629</span>            PlotChangeEvent e = new PlotChangeEvent(this);<a name="line.4629"></a>
<span class="sourceLineNo">4630</span>            e.setType(ChartChangeEventType.DATASET_UPDATED);<a name="line.4630"></a>
<span class="sourceLineNo">4631</span>            notifyListeners(e);<a name="line.4631"></a>
<span class="sourceLineNo">4632</span>        }<a name="line.4632"></a>
<span class="sourceLineNo">4633</span>    }<a name="line.4633"></a>
<span class="sourceLineNo">4634</span><a name="line.4634"></a>
<span class="sourceLineNo">4635</span>    /**<a name="line.4635"></a>
<span class="sourceLineNo">4636</span>     * Receives notification of a renderer change event.<a name="line.4636"></a>
<span class="sourceLineNo">4637</span>     *<a name="line.4637"></a>
<span class="sourceLineNo">4638</span>     * @param event  the event.<a name="line.4638"></a>
<span class="sourceLineNo">4639</span>     */<a name="line.4639"></a>
<span class="sourceLineNo">4640</span>    public void rendererChanged(RendererChangeEvent event) {<a name="line.4640"></a>
<span class="sourceLineNo">4641</span>        // if the event was caused by a change to series visibility, then<a name="line.4641"></a>
<span class="sourceLineNo">4642</span>        // the axis ranges might need updating...<a name="line.4642"></a>
<span class="sourceLineNo">4643</span>        if (event.getSeriesVisibilityChanged()) {<a name="line.4643"></a>
<span class="sourceLineNo">4644</span>            configureDomainAxes();<a name="line.4644"></a>
<span class="sourceLineNo">4645</span>            configureRangeAxes();<a name="line.4645"></a>
<span class="sourceLineNo">4646</span>        }<a name="line.4646"></a>
<span class="sourceLineNo">4647</span>        fireChangeEvent();<a name="line.4647"></a>
<span class="sourceLineNo">4648</span>    }<a name="line.4648"></a>
<span class="sourceLineNo">4649</span><a name="line.4649"></a>
<span class="sourceLineNo">4650</span>    /**<a name="line.4650"></a>
<span class="sourceLineNo">4651</span>     * Returns a flag indicating whether or not the domain crosshair is visible.<a name="line.4651"></a>
<span class="sourceLineNo">4652</span>     *<a name="line.4652"></a>
<span class="sourceLineNo">4653</span>     * @return The flag.<a name="line.4653"></a>
<span class="sourceLineNo">4654</span>     *<a name="line.4654"></a>
<span class="sourceLineNo">4655</span>     * @see #setDomainCrosshairVisible(boolean)<a name="line.4655"></a>
<span class="sourceLineNo">4656</span>     */<a name="line.4656"></a>
<span class="sourceLineNo">4657</span>    public boolean isDomainCrosshairVisible() {<a name="line.4657"></a>
<span class="sourceLineNo">4658</span>        return this.domainCrosshairVisible;<a name="line.4658"></a>
<span class="sourceLineNo">4659</span>    }<a name="line.4659"></a>
<span class="sourceLineNo">4660</span><a name="line.4660"></a>
<span class="sourceLineNo">4661</span>    /**<a name="line.4661"></a>
<span class="sourceLineNo">4662</span>     * Sets the flag indicating whether or not the domain crosshair is visible<a name="line.4662"></a>
<span class="sourceLineNo">4663</span>     * and, if the flag changes, sends a {@link PlotChangeEvent} to all<a name="line.4663"></a>
<span class="sourceLineNo">4664</span>     * registered listeners.<a name="line.4664"></a>
<span class="sourceLineNo">4665</span>     *<a name="line.4665"></a>
<span class="sourceLineNo">4666</span>     * @param flag  the new value of the flag.<a name="line.4666"></a>
<span class="sourceLineNo">4667</span>     *<a name="line.4667"></a>
<span class="sourceLineNo">4668</span>     * @see #isDomainCrosshairVisible()<a name="line.4668"></a>
<span class="sourceLineNo">4669</span>     */<a name="line.4669"></a>
<span class="sourceLineNo">4670</span>    public void setDomainCrosshairVisible(boolean flag) {<a name="line.4670"></a>
<span class="sourceLineNo">4671</span>        if (this.domainCrosshairVisible != flag) {<a name="line.4671"></a>
<span class="sourceLineNo">4672</span>            this.domainCrosshairVisible = flag;<a name="line.4672"></a>
<span class="sourceLineNo">4673</span>            fireChangeEvent();<a name="line.4673"></a>
<span class="sourceLineNo">4674</span>        }<a name="line.4674"></a>
<span class="sourceLineNo">4675</span>    }<a name="line.4675"></a>
<span class="sourceLineNo">4676</span><a name="line.4676"></a>
<span class="sourceLineNo">4677</span>    /**<a name="line.4677"></a>
<span class="sourceLineNo">4678</span>     * Returns a flag indicating whether or not the crosshair should "lock-on"<a name="line.4678"></a>
<span class="sourceLineNo">4679</span>     * to actual data values.<a name="line.4679"></a>
<span class="sourceLineNo">4680</span>     *<a name="line.4680"></a>
<span class="sourceLineNo">4681</span>     * @return The flag.<a name="line.4681"></a>
<span class="sourceLineNo">4682</span>     *<a name="line.4682"></a>
<span class="sourceLineNo">4683</span>     * @see #setDomainCrosshairLockedOnData(boolean)<a name="line.4683"></a>
<span class="sourceLineNo">4684</span>     */<a name="line.4684"></a>
<span class="sourceLineNo">4685</span>    public boolean isDomainCrosshairLockedOnData() {<a name="line.4685"></a>
<span class="sourceLineNo">4686</span>        return this.domainCrosshairLockedOnData;<a name="line.4686"></a>
<span class="sourceLineNo">4687</span>    }<a name="line.4687"></a>
<span class="sourceLineNo">4688</span><a name="line.4688"></a>
<span class="sourceLineNo">4689</span>    /**<a name="line.4689"></a>
<span class="sourceLineNo">4690</span>     * Sets the flag indicating whether or not the domain crosshair should<a name="line.4690"></a>
<span class="sourceLineNo">4691</span>     * "lock-on" to actual data values.  If the flag value changes, this<a name="line.4691"></a>
<span class="sourceLineNo">4692</span>     * method sends a {@link PlotChangeEvent} to all registered listeners.<a name="line.4692"></a>
<span class="sourceLineNo">4693</span>     *<a name="line.4693"></a>
<span class="sourceLineNo">4694</span>     * @param flag  the flag.<a name="line.4694"></a>
<span class="sourceLineNo">4695</span>     *<a name="line.4695"></a>
<span class="sourceLineNo">4696</span>     * @see #isDomainCrosshairLockedOnData()<a name="line.4696"></a>
<span class="sourceLineNo">4697</span>     */<a name="line.4697"></a>
<span class="sourceLineNo">4698</span>    public void setDomainCrosshairLockedOnData(boolean flag) {<a name="line.4698"></a>
<span class="sourceLineNo">4699</span>        if (this.domainCrosshairLockedOnData != flag) {<a name="line.4699"></a>
<span class="sourceLineNo">4700</span>            this.domainCrosshairLockedOnData = flag;<a name="line.4700"></a>
<span class="sourceLineNo">4701</span>            fireChangeEvent();<a name="line.4701"></a>
<span class="sourceLineNo">4702</span>        }<a name="line.4702"></a>
<span class="sourceLineNo">4703</span>    }<a name="line.4703"></a>
<span class="sourceLineNo">4704</span><a name="line.4704"></a>
<span class="sourceLineNo">4705</span>    /**<a name="line.4705"></a>
<span class="sourceLineNo">4706</span>     * Returns the domain crosshair value.<a name="line.4706"></a>
<span class="sourceLineNo">4707</span>     *<a name="line.4707"></a>
<span class="sourceLineNo">4708</span>     * @return The value.<a name="line.4708"></a>
<span class="sourceLineNo">4709</span>     *<a name="line.4709"></a>
<span class="sourceLineNo">4710</span>     * @see #setDomainCrosshairValue(double)<a name="line.4710"></a>
<span class="sourceLineNo">4711</span>     */<a name="line.4711"></a>
<span class="sourceLineNo">4712</span>    public double getDomainCrosshairValue() {<a name="line.4712"></a>
<span class="sourceLineNo">4713</span>        return this.domainCrosshairValue;<a name="line.4713"></a>
<span class="sourceLineNo">4714</span>    }<a name="line.4714"></a>
<span class="sourceLineNo">4715</span><a name="line.4715"></a>
<span class="sourceLineNo">4716</span>    /**<a name="line.4716"></a>
<span class="sourceLineNo">4717</span>     * Sets the domain crosshair value and sends a {@link PlotChangeEvent} to<a name="line.4717"></a>
<span class="sourceLineNo">4718</span>     * all registered listeners (provided that the domain crosshair is visible).<a name="line.4718"></a>
<span class="sourceLineNo">4719</span>     *<a name="line.4719"></a>
<span class="sourceLineNo">4720</span>     * @param value  the value.<a name="line.4720"></a>
<span class="sourceLineNo">4721</span>     *<a name="line.4721"></a>
<span class="sourceLineNo">4722</span>     * @see #getDomainCrosshairValue()<a name="line.4722"></a>
<span class="sourceLineNo">4723</span>     */<a name="line.4723"></a>
<span class="sourceLineNo">4724</span>    public void setDomainCrosshairValue(double value) {<a name="line.4724"></a>
<span class="sourceLineNo">4725</span>        setDomainCrosshairValue(value, true);<a name="line.4725"></a>
<span class="sourceLineNo">4726</span>    }<a name="line.4726"></a>
<span class="sourceLineNo">4727</span><a name="line.4727"></a>
<span class="sourceLineNo">4728</span>    /**<a name="line.4728"></a>
<span class="sourceLineNo">4729</span>     * Sets the domain crosshair value and, if requested, sends a<a name="line.4729"></a>
<span class="sourceLineNo">4730</span>     * {@link PlotChangeEvent} to all registered listeners (provided that the<a name="line.4730"></a>
<span class="sourceLineNo">4731</span>     * domain crosshair is visible).<a name="line.4731"></a>
<span class="sourceLineNo">4732</span>     *<a name="line.4732"></a>
<span class="sourceLineNo">4733</span>     * @param value  the new value.<a name="line.4733"></a>
<span class="sourceLineNo">4734</span>     * @param notify  notify listeners?<a name="line.4734"></a>
<span class="sourceLineNo">4735</span>     *<a name="line.4735"></a>
<span class="sourceLineNo">4736</span>     * @see #getDomainCrosshairValue()<a name="line.4736"></a>
<span class="sourceLineNo">4737</span>     */<a name="line.4737"></a>
<span class="sourceLineNo">4738</span>    public void setDomainCrosshairValue(double value, boolean notify) {<a name="line.4738"></a>
<span class="sourceLineNo">4739</span>        this.domainCrosshairValue = value;<a name="line.4739"></a>
<span class="sourceLineNo">4740</span>        if (isDomainCrosshairVisible() &amp;&amp; notify) {<a name="line.4740"></a>
<span class="sourceLineNo">4741</span>            fireChangeEvent();<a name="line.4741"></a>
<span class="sourceLineNo">4742</span>        }<a name="line.4742"></a>
<span class="sourceLineNo">4743</span>    }<a name="line.4743"></a>
<span class="sourceLineNo">4744</span><a name="line.4744"></a>
<span class="sourceLineNo">4745</span>    /**<a name="line.4745"></a>
<span class="sourceLineNo">4746</span>     * Returns the {@link Stroke} used to draw the crosshair (if visible).<a name="line.4746"></a>
<span class="sourceLineNo">4747</span>     *<a name="line.4747"></a>
<span class="sourceLineNo">4748</span>     * @return The crosshair stroke (never &lt;code&gt;null&lt;/code&gt;).<a name="line.4748"></a>
<span class="sourceLineNo">4749</span>     *<a name="line.4749"></a>
<span class="sourceLineNo">4750</span>     * @see #setDomainCrosshairStroke(Stroke)<a name="line.4750"></a>
<span class="sourceLineNo">4751</span>     * @see #isDomainCrosshairVisible()<a name="line.4751"></a>
<span class="sourceLineNo">4752</span>     * @see #getDomainCrosshairPaint()<a name="line.4752"></a>
<span class="sourceLineNo">4753</span>     */<a name="line.4753"></a>
<span class="sourceLineNo">4754</span>    public Stroke getDomainCrosshairStroke() {<a name="line.4754"></a>
<span class="sourceLineNo">4755</span>        return this.domainCrosshairStroke;<a name="line.4755"></a>
<span class="sourceLineNo">4756</span>    }<a name="line.4756"></a>
<span class="sourceLineNo">4757</span><a name="line.4757"></a>
<span class="sourceLineNo">4758</span>    /**<a name="line.4758"></a>
<span class="sourceLineNo">4759</span>     * Sets the Stroke used to draw the crosshairs (if visible) and notifies<a name="line.4759"></a>
<span class="sourceLineNo">4760</span>     * registered listeners that the axis has been modified.<a name="line.4760"></a>
<span class="sourceLineNo">4761</span>     *<a name="line.4761"></a>
<span class="sourceLineNo">4762</span>     * @param stroke  the new crosshair stroke (&lt;code&gt;null&lt;/code&gt; not<a name="line.4762"></a>
<span class="sourceLineNo">4763</span>     *     permitted).<a name="line.4763"></a>
<span class="sourceLineNo">4764</span>     *<a name="line.4764"></a>
<span class="sourceLineNo">4765</span>     * @see #getDomainCrosshairStroke()<a name="line.4765"></a>
<span class="sourceLineNo">4766</span>     */<a name="line.4766"></a>
<span class="sourceLineNo">4767</span>    public void setDomainCrosshairStroke(Stroke stroke) {<a name="line.4767"></a>
<span class="sourceLineNo">4768</span>        if (stroke == null) {<a name="line.4768"></a>
<span class="sourceLineNo">4769</span>            throw new IllegalArgumentException("Null 'stroke' argument.");<a name="line.4769"></a>
<span class="sourceLineNo">4770</span>        }<a name="line.4770"></a>
<span class="sourceLineNo">4771</span>        this.domainCrosshairStroke = stroke;<a name="line.4771"></a>
<span class="sourceLineNo">4772</span>        fireChangeEvent();<a name="line.4772"></a>
<span class="sourceLineNo">4773</span>    }<a name="line.4773"></a>
<span class="sourceLineNo">4774</span><a name="line.4774"></a>
<span class="sourceLineNo">4775</span>    /**<a name="line.4775"></a>
<span class="sourceLineNo">4776</span>     * Returns the domain crosshair paint.<a name="line.4776"></a>
<span class="sourceLineNo">4777</span>     *<a name="line.4777"></a>
<span class="sourceLineNo">4778</span>     * @return The crosshair paint (never &lt;code&gt;null&lt;/code&gt;).<a name="line.4778"></a>
<span class="sourceLineNo">4779</span>     *<a name="line.4779"></a>
<span class="sourceLineNo">4780</span>     * @see #setDomainCrosshairPaint(Paint)<a name="line.4780"></a>
<span class="sourceLineNo">4781</span>     * @see #isDomainCrosshairVisible()<a name="line.4781"></a>
<span class="sourceLineNo">4782</span>     * @see #getDomainCrosshairStroke()<a name="line.4782"></a>
<span class="sourceLineNo">4783</span>     */<a name="line.4783"></a>
<span class="sourceLineNo">4784</span>    public Paint getDomainCrosshairPaint() {<a name="line.4784"></a>
<span class="sourceLineNo">4785</span>        return this.domainCrosshairPaint;<a name="line.4785"></a>
<span class="sourceLineNo">4786</span>    }<a name="line.4786"></a>
<span class="sourceLineNo">4787</span><a name="line.4787"></a>
<span class="sourceLineNo">4788</span>    /**<a name="line.4788"></a>
<span class="sourceLineNo">4789</span>     * Sets the paint used to draw the crosshairs (if visible) and sends a<a name="line.4789"></a>
<span class="sourceLineNo">4790</span>     * {@link PlotChangeEvent} to all registered listeners.<a name="line.4790"></a>
<span class="sourceLineNo">4791</span>     *<a name="line.4791"></a>
<span class="sourceLineNo">4792</span>     * @param paint the new crosshair paint (&lt;code&gt;null&lt;/code&gt; not permitted).<a name="line.4792"></a>
<span class="sourceLineNo">4793</span>     *<a name="line.4793"></a>
<span class="sourceLineNo">4794</span>     * @see #getDomainCrosshairPaint()<a name="line.4794"></a>
<span class="sourceLineNo">4795</span>     */<a name="line.4795"></a>
<span class="sourceLineNo">4796</span>    public void setDomainCrosshairPaint(Paint paint) {<a name="line.4796"></a>
<span class="sourceLineNo">4797</span>        if (paint == null) {<a name="line.4797"></a>
<span class="sourceLineNo">4798</span>            throw new IllegalArgumentException("Null 'paint' argument.");<a name="line.4798"></a>
<span class="sourceLineNo">4799</span>        }<a name="line.4799"></a>
<span class="sourceLineNo">4800</span>        this.domainCrosshairPaint = paint;<a name="line.4800"></a>
<span class="sourceLineNo">4801</span>        fireChangeEvent();<a name="line.4801"></a>
<span class="sourceLineNo">4802</span>    }<a name="line.4802"></a>
<span class="sourceLineNo">4803</span><a name="line.4803"></a>
<span class="sourceLineNo">4804</span>    /**<a name="line.4804"></a>
<span class="sourceLineNo">4805</span>     * Returns a flag indicating whether or not the range crosshair is visible.<a name="line.4805"></a>
<span class="sourceLineNo">4806</span>     *<a name="line.4806"></a>
<span class="sourceLineNo">4807</span>     * @return The flag.<a name="line.4807"></a>
<span class="sourceLineNo">4808</span>     *<a name="line.4808"></a>
<span class="sourceLineNo">4809</span>     * @see #setRangeCrosshairVisible(boolean)<a name="line.4809"></a>
<span class="sourceLineNo">4810</span>     * @see #isDomainCrosshairVisible()<a name="line.4810"></a>
<span class="sourceLineNo">4811</span>     */<a name="line.4811"></a>
<span class="sourceLineNo">4812</span>    public boolean isRangeCrosshairVisible() {<a name="line.4812"></a>
<span class="sourceLineNo">4813</span>        return this.rangeCrosshairVisible;<a name="line.4813"></a>
<span class="sourceLineNo">4814</span>    }<a name="line.4814"></a>
<span class="sourceLineNo">4815</span><a name="line.4815"></a>
<span class="sourceLineNo">4816</span>    /**<a name="line.4816"></a>
<span class="sourceLineNo">4817</span>     * Sets the flag indicating whether or not the range crosshair is visible.<a name="line.4817"></a>
<span class="sourceLineNo">4818</span>     * If the flag value changes, this method sends a {@link PlotChangeEvent}<a name="line.4818"></a>
<span class="sourceLineNo">4819</span>     * to all registered listeners.<a name="line.4819"></a>
<span class="sourceLineNo">4820</span>     *<a name="line.4820"></a>
<span class="sourceLineNo">4821</span>     * @param flag  the new value of the flag.<a name="line.4821"></a>
<span class="sourceLineNo">4822</span>     *<a name="line.4822"></a>
<span class="sourceLineNo">4823</span>     * @see #isRangeCrosshairVisible()<a name="line.4823"></a>
<span class="sourceLineNo">4824</span>     */<a name="line.4824"></a>
<span class="sourceLineNo">4825</span>    public void setRangeCrosshairVisible(boolean flag) {<a name="line.4825"></a>
<span class="sourceLineNo">4826</span>        if (this.rangeCrosshairVisible != flag) {<a name="line.4826"></a>
<span class="sourceLineNo">4827</span>            this.rangeCrosshairVisible = flag;<a name="line.4827"></a>
<span class="sourceLineNo">4828</span>            fireChangeEvent();<a name="line.4828"></a>
<span class="sourceLineNo">4829</span>        }<a name="line.4829"></a>
<span class="sourceLineNo">4830</span>    }<a name="line.4830"></a>
<span class="sourceLineNo">4831</span><a name="line.4831"></a>
<span class="sourceLineNo">4832</span>    /**<a name="line.4832"></a>
<span class="sourceLineNo">4833</span>     * Returns a flag indicating whether or not the crosshair should "lock-on"<a name="line.4833"></a>
<span class="sourceLineNo">4834</span>     * to actual data values.<a name="line.4834"></a>
<span class="sourceLineNo">4835</span>     *<a name="line.4835"></a>
<span class="sourceLineNo">4836</span>     * @return The flag.<a name="line.4836"></a>
<span class="sourceLineNo">4837</span>     *<a name="line.4837"></a>
<span class="sourceLineNo">4838</span>     * @see #setRangeCrosshairLockedOnData(boolean)<a name="line.4838"></a>
<span class="sourceLineNo">4839</span>     */<a name="line.4839"></a>
<span class="sourceLineNo">4840</span>    public boolean isRangeCrosshairLockedOnData() {<a name="line.4840"></a>
<span class="sourceLineNo">4841</span>        return this.rangeCrosshairLockedOnData;<a name="line.4841"></a>
<span class="sourceLineNo">4842</span>    }<a name="line.4842"></a>
<span class="sourceLineNo">4843</span><a name="line.4843"></a>
<span class="sourceLineNo">4844</span>    /**<a name="line.4844"></a>
<span class="sourceLineNo">4845</span>     * Sets the flag indicating whether or not the range crosshair should<a name="line.4845"></a>
<span class="sourceLineNo">4846</span>     * "lock-on" to actual data values.  If the flag value changes, this method<a name="line.4846"></a>
<span class="sourceLineNo">4847</span>     * sends a {@link PlotChangeEvent} to all registered listeners.<a name="line.4847"></a>
<span class="sourceLineNo">4848</span>     *<a name="line.4848"></a>
<span class="sourceLineNo">4849</span>     * @param flag  the flag.<a name="line.4849"></a>
<span class="sourceLineNo">4850</span>     *<a name="line.4850"></a>
<span class="sourceLineNo">4851</span>     * @see #isRangeCrosshairLockedOnData()<a name="line.4851"></a>
<span class="sourceLineNo">4852</span>     */<a name="line.4852"></a>
<span class="sourceLineNo">4853</span>    public void setRangeCrosshairLockedOnData(boolean flag) {<a name="line.4853"></a>
<span class="sourceLineNo">4854</span>        if (this.rangeCrosshairLockedOnData != flag) {<a name="line.4854"></a>
<span class="sourceLineNo">4855</span>            this.rangeCrosshairLockedOnData = flag;<a name="line.4855"></a>
<span class="sourceLineNo">4856</span>            fireChangeEvent();<a name="line.4856"></a>
<span class="sourceLineNo">4857</span>        }<a name="line.4857"></a>
<span class="sourceLineNo">4858</span>    }<a name="line.4858"></a>
<span class="sourceLineNo">4859</span><a name="line.4859"></a>
<span class="sourceLineNo">4860</span>    /**<a name="line.4860"></a>
<span class="sourceLineNo">4861</span>     * Returns the range crosshair value.<a name="line.4861"></a>
<span class="sourceLineNo">4862</span>     *<a name="line.4862"></a>
<span class="sourceLineNo">4863</span>     * @return The value.<a name="line.4863"></a>
<span class="sourceLineNo">4864</span>     *<a name="line.4864"></a>
<span class="sourceLineNo">4865</span>     * @see #setRangeCrosshairValue(double)<a name="line.4865"></a>
<span class="sourceLineNo">4866</span>     */<a name="line.4866"></a>
<span class="sourceLineNo">4867</span>    public double getRangeCrosshairValue() {<a name="line.4867"></a>
<span class="sourceLineNo">4868</span>        return this.rangeCrosshairValue;<a name="line.4868"></a>
<span class="sourceLineNo">4869</span>    }<a name="line.4869"></a>
<span class="sourceLineNo">4870</span><a name="line.4870"></a>
<span class="sourceLineNo">4871</span>    /**<a name="line.4871"></a>
<span class="sourceLineNo">4872</span>     * Sets the range crosshair value.<a name="line.4872"></a>
<span class="sourceLineNo">4873</span>     * &lt;P&gt;<a name="line.4873"></a>
<span class="sourceLineNo">4874</span>     * Registered listeners are notified that the plot has been modified, but<a name="line.4874"></a>
<span class="sourceLineNo">4875</span>     * only if the crosshair is visible.<a name="line.4875"></a>
<span class="sourceLineNo">4876</span>     *<a name="line.4876"></a>
<span class="sourceLineNo">4877</span>     * @param value  the new value.<a name="line.4877"></a>
<span class="sourceLineNo">4878</span>     *<a name="line.4878"></a>
<span class="sourceLineNo">4879</span>     * @see #getRangeCrosshairValue()<a name="line.4879"></a>
<span class="sourceLineNo">4880</span>     */<a name="line.4880"></a>
<span class="sourceLineNo">4881</span>    public void setRangeCrosshairValue(double value) {<a name="line.4881"></a>
<span class="sourceLineNo">4882</span>        setRangeCrosshairValue(value, true);<a name="line.4882"></a>
<span class="sourceLineNo">4883</span>    }<a name="line.4883"></a>
<span class="sourceLineNo">4884</span><a name="line.4884"></a>
<span class="sourceLineNo">4885</span>    /**<a name="line.4885"></a>
<span class="sourceLineNo">4886</span>     * Sets the range crosshair value and sends a {@link PlotChangeEvent} to<a name="line.4886"></a>
<span class="sourceLineNo">4887</span>     * all registered listeners, but only if the crosshair is visible.<a name="line.4887"></a>
<span class="sourceLineNo">4888</span>     *<a name="line.4888"></a>
<span class="sourceLineNo">4889</span>     * @param value  the new value.<a name="line.4889"></a>
<span class="sourceLineNo">4890</span>     * @param notify  a flag that controls whether or not listeners are<a name="line.4890"></a>
<span class="sourceLineNo">4891</span>     *                notified.<a name="line.4891"></a>
<span class="sourceLineNo">4892</span>     *<a name="line.4892"></a>
<span class="sourceLineNo">4893</span>     * @see #getRangeCrosshairValue()<a name="line.4893"></a>
<span class="sourceLineNo">4894</span>     */<a name="line.4894"></a>
<span class="sourceLineNo">4895</span>    public void setRangeCrosshairValue(double value, boolean notify) {<a name="line.4895"></a>
<span class="sourceLineNo">4896</span>        this.rangeCrosshairValue = value;<a name="line.4896"></a>
<span class="sourceLineNo">4897</span>        if (isRangeCrosshairVisible() &amp;&amp; notify) {<a name="line.4897"></a>
<span class="sourceLineNo">4898</span>            fireChangeEvent();<a name="line.4898"></a>
<span class="sourceLineNo">4899</span>        }<a name="line.4899"></a>
<span class="sourceLineNo">4900</span>    }<a name="line.4900"></a>
<span class="sourceLineNo">4901</span><a name="line.4901"></a>
<span class="sourceLineNo">4902</span>    /**<a name="line.4902"></a>
<span class="sourceLineNo">4903</span>     * Returns the stroke used to draw the crosshair (if visible).<a name="line.4903"></a>
<span class="sourceLineNo">4904</span>     *<a name="line.4904"></a>
<span class="sourceLineNo">4905</span>     * @return The crosshair stroke (never &lt;code&gt;null&lt;/code&gt;).<a name="line.4905"></a>
<span class="sourceLineNo">4906</span>     *<a name="line.4906"></a>
<span class="sourceLineNo">4907</span>     * @see #setRangeCrosshairStroke(Stroke)<a name="line.4907"></a>
<span class="sourceLineNo">4908</span>     * @see #isRangeCrosshairVisible()<a name="line.4908"></a>
<span class="sourceLineNo">4909</span>     * @see #getRangeCrosshairPaint()<a name="line.4909"></a>
<span class="sourceLineNo">4910</span>     */<a name="line.4910"></a>
<span class="sourceLineNo">4911</span>    public Stroke getRangeCrosshairStroke() {<a name="line.4911"></a>
<span class="sourceLineNo">4912</span>        return this.rangeCrosshairStroke;<a name="line.4912"></a>
<span class="sourceLineNo">4913</span>    }<a name="line.4913"></a>
<span class="sourceLineNo">4914</span><a name="line.4914"></a>
<span class="sourceLineNo">4915</span>    /**<a name="line.4915"></a>
<span class="sourceLineNo">4916</span>     * Sets the stroke used to draw the crosshairs (if visible) and sends a<a name="line.4916"></a>
<span class="sourceLineNo">4917</span>     * {@link PlotChangeEvent} to all registered listeners.<a name="line.4917"></a>
<span class="sourceLineNo">4918</span>     *<a name="line.4918"></a>
<span class="sourceLineNo">4919</span>     * @param stroke  the new crosshair stroke (&lt;code&gt;null&lt;/code&gt; not<a name="line.4919"></a>
<span class="sourceLineNo">4920</span>     *         permitted).<a name="line.4920"></a>
<span class="sourceLineNo">4921</span>     *<a name="line.4921"></a>
<span class="sourceLineNo">4922</span>     * @see #getRangeCrosshairStroke()<a name="line.4922"></a>
<span class="sourceLineNo">4923</span>     */<a name="line.4923"></a>
<span class="sourceLineNo">4924</span>    public void setRangeCrosshairStroke(Stroke stroke) {<a name="line.4924"></a>
<span class="sourceLineNo">4925</span>        if (stroke == null) {<a name="line.4925"></a>
<span class="sourceLineNo">4926</span>            throw new IllegalArgumentException("Null 'stroke' argument.");<a name="line.4926"></a>
<span class="sourceLineNo">4927</span>        }<a name="line.4927"></a>
<span class="sourceLineNo">4928</span>        this.rangeCrosshairStroke = stroke;<a name="line.4928"></a>
<span class="sourceLineNo">4929</span>        fireChangeEvent();<a name="line.4929"></a>
<span class="sourceLineNo">4930</span>    }<a name="line.4930"></a>
<span class="sourceLineNo">4931</span><a name="line.4931"></a>
<span class="sourceLineNo">4932</span>    /**<a name="line.4932"></a>
<span class="sourceLineNo">4933</span>     * Returns the range crosshair paint.<a name="line.4933"></a>
<span class="sourceLineNo">4934</span>     *<a name="line.4934"></a>
<span class="sourceLineNo">4935</span>     * @return The crosshair paint (never &lt;code&gt;null&lt;/code&gt;).<a name="line.4935"></a>
<span class="sourceLineNo">4936</span>     *<a name="line.4936"></a>
<span class="sourceLineNo">4937</span>     * @see #setRangeCrosshairPaint(Paint)<a name="line.4937"></a>
<span class="sourceLineNo">4938</span>     * @see #isRangeCrosshairVisible()<a name="line.4938"></a>
<span class="sourceLineNo">4939</span>     * @see #getRangeCrosshairStroke()<a name="line.4939"></a>
<span class="sourceLineNo">4940</span>     */<a name="line.4940"></a>
<span class="sourceLineNo">4941</span>    public Paint getRangeCrosshairPaint() {<a name="line.4941"></a>
<span class="sourceLineNo">4942</span>        return this.rangeCrosshairPaint;<a name="line.4942"></a>
<span class="sourceLineNo">4943</span>    }<a name="line.4943"></a>
<span class="sourceLineNo">4944</span><a name="line.4944"></a>
<span class="sourceLineNo">4945</span>    /**<a name="line.4945"></a>
<span class="sourceLineNo">4946</span>     * Sets the paint used to color the crosshairs (if visible) and sends a<a name="line.4946"></a>
<span class="sourceLineNo">4947</span>     * {@link PlotChangeEvent} to all registered listeners.<a name="line.4947"></a>
<span class="sourceLineNo">4948</span>     *<a name="line.4948"></a>
<span class="sourceLineNo">4949</span>     * @param paint the new crosshair paint (&lt;code&gt;null&lt;/code&gt; not permitted).<a name="line.4949"></a>
<span class="sourceLineNo">4950</span>     *<a name="line.4950"></a>
<span class="sourceLineNo">4951</span>     * @see #getRangeCrosshairPaint()<a name="line.4951"></a>
<span class="sourceLineNo">4952</span>     */<a name="line.4952"></a>
<span class="sourceLineNo">4953</span>    public void setRangeCrosshairPaint(Paint paint) {<a name="line.4953"></a>
<span class="sourceLineNo">4954</span>        if (paint == null) {<a name="line.4954"></a>
<span class="sourceLineNo">4955</span>            throw new IllegalArgumentException("Null 'paint' argument.");<a name="line.4955"></a>
<span class="sourceLineNo">4956</span>        }<a name="line.4956"></a>
<span class="sourceLineNo">4957</span>        this.rangeCrosshairPaint = paint;<a name="line.4957"></a>
<span class="sourceLineNo">4958</span>        fireChangeEvent();<a name="line.4958"></a>
<span class="sourceLineNo">4959</span>    }<a name="line.4959"></a>
<span class="sourceLineNo">4960</span><a name="line.4960"></a>
<span class="sourceLineNo">4961</span>    /**<a name="line.4961"></a>
<span class="sourceLineNo">4962</span>     * Returns the fixed domain axis space.<a name="line.4962"></a>
<span class="sourceLineNo">4963</span>     *<a name="line.4963"></a>
<span class="sourceLineNo">4964</span>     * @return The fixed domain axis space (possibly &lt;code&gt;null&lt;/code&gt;).<a name="line.4964"></a>
<span class="sourceLineNo">4965</span>     *<a name="line.4965"></a>
<span class="sourceLineNo">4966</span>     * @see #setFixedDomainAxisSpace(AxisSpace)<a name="line.4966"></a>
<span class="sourceLineNo">4967</span>     */<a name="line.4967"></a>
<span class="sourceLineNo">4968</span>    public AxisSpace getFixedDomainAxisSpace() {<a name="line.4968"></a>
<span class="sourceLineNo">4969</span>        return this.fixedDomainAxisSpace;<a name="line.4969"></a>
<span class="sourceLineNo">4970</span>    }<a name="line.4970"></a>
<span class="sourceLineNo">4971</span><a name="line.4971"></a>
<span class="sourceLineNo">4972</span>    /**<a name="line.4972"></a>
<span class="sourceLineNo">4973</span>     * Sets the fixed domain axis space and sends a {@link PlotChangeEvent} to<a name="line.4973"></a>
<span class="sourceLineNo">4974</span>     * all registered listeners.<a name="line.4974"></a>
<span class="sourceLineNo">4975</span>     *<a name="line.4975"></a>
<span class="sourceLineNo">4976</span>     * @param space  the space (&lt;code&gt;null&lt;/code&gt; permitted).<a name="line.4976"></a>
<span class="sourceLineNo">4977</span>     *<a name="line.4977"></a>
<span class="sourceLineNo">4978</span>     * @see #getFixedDomainAxisSpace()<a name="line.4978"></a>
<span class="sourceLineNo">4979</span>     */<a name="line.4979"></a>
<span class="sourceLineNo">4980</span>    public void setFixedDomainAxisSpace(AxisSpace space) {<a name="line.4980"></a>
<span class="sourceLineNo">4981</span>        setFixedDomainAxisSpace(space, true);<a name="line.4981"></a>
<span class="sourceLineNo">4982</span>    }<a name="line.4982"></a>
<span class="sourceLineNo">4983</span><a name="line.4983"></a>
<span class="sourceLineNo">4984</span>    /**<a name="line.4984"></a>
<span class="sourceLineNo">4985</span>     * Sets the fixed domain axis space and, if requested, sends a<a name="line.4985"></a>
<span class="sourceLineNo">4986</span>     * {@link PlotChangeEvent} to all registered listeners.<a name="line.4986"></a>
<span class="sourceLineNo">4987</span>     *<a name="line.4987"></a>
<span class="sourceLineNo">4988</span>     * @param space  the space (&lt;code&gt;null&lt;/code&gt; permitted).<a name="line.4988"></a>
<span class="sourceLineNo">4989</span>     * @param notify  notify listeners?<a name="line.4989"></a>
<span class="sourceLineNo">4990</span>     *<a name="line.4990"></a>
<span class="sourceLineNo">4991</span>     * @see #getFixedDomainAxisSpace()<a name="line.4991"></a>
<span class="sourceLineNo">4992</span>     *<a name="line.4992"></a>
<span class="sourceLineNo">4993</span>     * @since 1.0.9<a name="line.4993"></a>
<span class="sourceLineNo">4994</span>     */<a name="line.4994"></a>
<span class="sourceLineNo">4995</span>    public void setFixedDomainAxisSpace(AxisSpace space, boolean notify) {<a name="line.4995"></a>
<span class="sourceLineNo">4996</span>        this.fixedDomainAxisSpace = space;<a name="line.4996"></a>
<span class="sourceLineNo">4997</span>        if (notify) {<a name="line.4997"></a>
<span class="sourceLineNo">4998</span>            fireChangeEvent();<a name="line.4998"></a>
<span class="sourceLineNo">4999</span>        }<a name="line.4999"></a>
<span class="sourceLineNo">5000</span>    }<a name="line.5000"></a>
<span class="sourceLineNo">5001</span><a name="line.5001"></a>
<span class="sourceLineNo">5002</span>    /**<a name="line.5002"></a>
<span class="sourceLineNo">5003</span>     * Returns the fixed range axis space.<a name="line.5003"></a>
<span class="sourceLineNo">5004</span>     *<a name="line.5004"></a>
<span class="sourceLineNo">5005</span>     * @return The fixed range axis space (possibly &lt;code&gt;null&lt;/code&gt;).<a name="line.5005"></a>
<span class="sourceLineNo">5006</span>     *<a name="line.5006"></a>
<span class="sourceLineNo">5007</span>     * @see #setFixedRangeAxisSpace(AxisSpace)<a name="line.5007"></a>
<span class="sourceLineNo">5008</span>     */<a name="line.5008"></a>
<span class="sourceLineNo">5009</span>    public AxisSpace getFixedRangeAxisSpace() {<a name="line.5009"></a>
<span class="sourceLineNo">5010</span>        return this.fixedRangeAxisSpace;<a name="line.5010"></a>
<span class="sourceLineNo">5011</span>    }<a name="line.5011"></a>
<span class="sourceLineNo">5012</span><a name="line.5012"></a>
<span class="sourceLineNo">5013</span>    /**<a name="line.5013"></a>
<span class="sourceLineNo">5014</span>     * Sets the fixed range axis space and sends a {@link PlotChangeEvent} to<a name="line.5014"></a>
<span class="sourceLineNo">5015</span>     * all registered listeners.<a name="line.5015"></a>
<span class="sourceLineNo">5016</span>     *<a name="line.5016"></a>
<span class="sourceLineNo">5017</span>     * @param space  the space (&lt;code&gt;null&lt;/code&gt; permitted).<a name="line.5017"></a>
<span class="sourceLineNo">5018</span>     *<a name="line.5018"></a>
<span class="sourceLineNo">5019</span>     * @see #getFixedRangeAxisSpace()<a name="line.5019"></a>
<span class="sourceLineNo">5020</span>     */<a name="line.5020"></a>
<span class="sourceLineNo">5021</span>    public void setFixedRangeAxisSpace(AxisSpace space) {<a name="line.5021"></a>
<span class="sourceLineNo">5022</span>        setFixedRangeAxisSpace(space, true);<a name="line.5022"></a>
<span class="sourceLineNo">5023</span>    }<a name="line.5023"></a>
<span class="sourceLineNo">5024</span><a name="line.5024"></a>
<span class="sourceLineNo">5025</span>    /**<a name="line.5025"></a>
<span class="sourceLineNo">5026</span>     * Sets the fixed range axis space and, if requested, sends a<a name="line.5026"></a>
<span class="sourceLineNo">5027</span>     * {@link PlotChangeEvent} to all registered listeners.<a name="line.5027"></a>
<span class="sourceLineNo">5028</span>     *<a name="line.5028"></a>
<span class="sourceLineNo">5029</span>     * @param space  the space (&lt;code&gt;null&lt;/code&gt; permitted).<a name="line.5029"></a>
<span class="sourceLineNo">5030</span>     * @param notify  notify listeners?<a name="line.5030"></a>
<span class="sourceLineNo">5031</span>     *<a name="line.5031"></a>
<span class="sourceLineNo">5032</span>     * @see #getFixedRangeAxisSpace()<a name="line.5032"></a>
<span class="sourceLineNo">5033</span>     *<a name="line.5033"></a>
<span class="sourceLineNo">5034</span>     * @since 1.0.9<a name="line.5034"></a>
<span class="sourceLineNo">5035</span>     */<a name="line.5035"></a>
<span class="sourceLineNo">5036</span>    public void setFixedRangeAxisSpace(AxisSpace space, boolean notify) {<a name="line.5036"></a>
<span class="sourceLineNo">5037</span>        this.fixedRangeAxisSpace = space;<a name="line.5037"></a>
<span class="sourceLineNo">5038</span>        if (notify) {<a name="line.5038"></a>
<span class="sourceLineNo">5039</span>            fireChangeEvent();<a name="line.5039"></a>
<span class="sourceLineNo">5040</span>        }<a name="line.5040"></a>
<span class="sourceLineNo">5041</span>    }<a name="line.5041"></a>
<span class="sourceLineNo">5042</span><a name="line.5042"></a>
<span class="sourceLineNo">5043</span>    /**<a name="line.5043"></a>
<span class="sourceLineNo">5044</span>     * Returns &lt;code&gt;true&lt;/code&gt; if panning is enabled for the domain axes,<a name="line.5044"></a>
<span class="sourceLineNo">5045</span>     * and &lt;code&gt;false&lt;/code&gt; otherwise.<a name="line.5045"></a>
<span class="sourceLineNo">5046</span>     *<a name="line.5046"></a>
<span class="sourceLineNo">5047</span>     * @return A boolean.<a name="line.5047"></a>
<span class="sourceLineNo">5048</span>     *<a name="line.5048"></a>
<span class="sourceLineNo">5049</span>     * @since 1.0.13<a name="line.5049"></a>
<span class="sourceLineNo">5050</span>     */<a name="line.5050"></a>
<span class="sourceLineNo">5051</span>    public boolean isDomainPannable() {<a name="line.5051"></a>
<span class="sourceLineNo">5052</span>        return this.domainPannable;<a name="line.5052"></a>
<span class="sourceLineNo">5053</span>    }<a name="line.5053"></a>
<span class="sourceLineNo">5054</span><a name="line.5054"></a>
<span class="sourceLineNo">5055</span>    /**<a name="line.5055"></a>
<span class="sourceLineNo">5056</span>     * Sets the flag that enables or disables panning of the plot along the<a name="line.5056"></a>
<span class="sourceLineNo">5057</span>     * domain axes.<a name="line.5057"></a>
<span class="sourceLineNo">5058</span>     *<a name="line.5058"></a>
<span class="sourceLineNo">5059</span>     * @param pannable  the new flag value.<a name="line.5059"></a>
<span class="sourceLineNo">5060</span>     *<a name="line.5060"></a>
<span class="sourceLineNo">5061</span>     * @since 1.0.13<a name="line.5061"></a>
<span class="sourceLineNo">5062</span>     */<a name="line.5062"></a>
<span class="sourceLineNo">5063</span>    public void setDomainPannable(boolean pannable) {<a name="line.5063"></a>
<span class="sourceLineNo">5064</span>        this.domainPannable = pannable;<a name="line.5064"></a>
<span class="sourceLineNo">5065</span>    }<a name="line.5065"></a>
<span class="sourceLineNo">5066</span><a name="line.5066"></a>
<span class="sourceLineNo">5067</span>    /**<a name="line.5067"></a>
<span class="sourceLineNo">5068</span>     * Returns &lt;code&gt;true&lt;/code&gt; if panning is enabled for the range axes,<a name="line.5068"></a>
<span class="sourceLineNo">5069</span>     * and &lt;code&gt;false&lt;/code&gt; otherwise.<a name="line.5069"></a>
<span class="sourceLineNo">5070</span>     *<a name="line.5070"></a>
<span class="sourceLineNo">5071</span>     * @return A boolean.<a name="line.5071"></a>
<span class="sourceLineNo">5072</span>     *<a name="line.5072"></a>
<span class="sourceLineNo">5073</span>     * @since 1.0.13<a name="line.5073"></a>
<span class="sourceLineNo">5074</span>     */<a name="line.5074"></a>
<span class="sourceLineNo">5075</span>    public boolean isRangePannable() {<a name="line.5075"></a>
<span class="sourceLineNo">5076</span>        return this.rangePannable;<a name="line.5076"></a>
<span class="sourceLineNo">5077</span>    }<a name="line.5077"></a>
<span class="sourceLineNo">5078</span><a name="line.5078"></a>
<span class="sourceLineNo">5079</span>    /**<a name="line.5079"></a>
<span class="sourceLineNo">5080</span>     * Sets the flag that enables or disables panning of the plot along<a name="line.5080"></a>
<span class="sourceLineNo">5081</span>     * the range axes.<a name="line.5081"></a>
<span class="sourceLineNo">5082</span>     *<a name="line.5082"></a>
<span class="sourceLineNo">5083</span>     * @param pannable  the new flag value.<a name="line.5083"></a>
<span class="sourceLineNo">5084</span>     *<a name="line.5084"></a>
<span class="sourceLineNo">5085</span>     * @since 1.0.13<a name="line.5085"></a>
<span class="sourceLineNo">5086</span>     */<a name="line.5086"></a>
<span class="sourceLineNo">5087</span>    public void setRangePannable(boolean pannable) {<a name="line.5087"></a>
<span class="sourceLineNo">5088</span>        this.rangePannable = pannable;<a name="line.5088"></a>
<span class="sourceLineNo">5089</span>    }<a name="line.5089"></a>
<span class="sourceLineNo">5090</span><a name="line.5090"></a>
<span class="sourceLineNo">5091</span>    /**<a name="line.5091"></a>
<span class="sourceLineNo">5092</span>     * Pans the domain axes by the specified percentage.<a name="line.5092"></a>
<span class="sourceLineNo">5093</span>     *<a name="line.5093"></a>
<span class="sourceLineNo">5094</span>     * @param percent  the distance to pan (as a percentage of the axis length).<a name="line.5094"></a>
<span class="sourceLineNo">5095</span>     * @param info the plot info<a name="line.5095"></a>
<span class="sourceLineNo">5096</span>     * @param source the source point where the pan action started.<a name="line.5096"></a>
<span class="sourceLineNo">5097</span>     *<a name="line.5097"></a>
<span class="sourceLineNo">5098</span>     * @since 1.0.13<a name="line.5098"></a>
<span class="sourceLineNo">5099</span>     */<a name="line.5099"></a>
<span class="sourceLineNo">5100</span>    public void panDomainAxes(double percent, PlotRenderingInfo info,<a name="line.5100"></a>
<span class="sourceLineNo">5101</span>            Point2D source) {<a name="line.5101"></a>
<span class="sourceLineNo">5102</span>        if (!isDomainPannable()) {<a name="line.5102"></a>
<span class="sourceLineNo">5103</span>            return;<a name="line.5103"></a>
<span class="sourceLineNo">5104</span>        }<a name="line.5104"></a>
<span class="sourceLineNo">5105</span>        int domainAxisCount = getDomainAxisCount();<a name="line.5105"></a>
<span class="sourceLineNo">5106</span>        for (int i = 0; i &lt; domainAxisCount; i++) {<a name="line.5106"></a>
<span class="sourceLineNo">5107</span>            ValueAxis axis = getDomainAxis(i);<a name="line.5107"></a>
<span class="sourceLineNo">5108</span>            if (axis == null) {<a name="line.5108"></a>
<span class="sourceLineNo">5109</span>                continue;<a name="line.5109"></a>
<span class="sourceLineNo">5110</span>            }<a name="line.5110"></a>
<span class="sourceLineNo">5111</span>            if (axis.isInverted()) {<a name="line.5111"></a>
<span class="sourceLineNo">5112</span>                percent = -percent;<a name="line.5112"></a>
<span class="sourceLineNo">5113</span>            }<a name="line.5113"></a>
<span class="sourceLineNo">5114</span>            axis.pan(percent);<a name="line.5114"></a>
<span class="sourceLineNo">5115</span>        }<a name="line.5115"></a>
<span class="sourceLineNo">5116</span>    }<a name="line.5116"></a>
<span class="sourceLineNo">5117</span><a name="line.5117"></a>
<span class="sourceLineNo">5118</span>    /**<a name="line.5118"></a>
<span class="sourceLineNo">5119</span>     * Pans the range axes by the specified percentage.<a name="line.5119"></a>
<span class="sourceLineNo">5120</span>     *<a name="line.5120"></a>
<span class="sourceLineNo">5121</span>     * @param percent  the distance to pan (as a percentage of the axis length).<a name="line.5121"></a>
<span class="sourceLineNo">5122</span>     * @param info the plot info<a name="line.5122"></a>
<span class="sourceLineNo">5123</span>     * @param source the source point where the pan action started.<a name="line.5123"></a>
<span class="sourceLineNo">5124</span>     *<a name="line.5124"></a>
<span class="sourceLineNo">5125</span>     * @since 1.0.13<a name="line.5125"></a>
<span class="sourceLineNo">5126</span>     */<a name="line.5126"></a>
<span class="sourceLineNo">5127</span>    public void panRangeAxes(double percent, PlotRenderingInfo info,<a name="line.5127"></a>
<span class="sourceLineNo">5128</span>            Point2D source) {<a name="line.5128"></a>
<span class="sourceLineNo">5129</span>        if (!isRangePannable()) {<a name="line.5129"></a>
<span class="sourceLineNo">5130</span>            return;<a name="line.5130"></a>
<span class="sourceLineNo">5131</span>        }<a name="line.5131"></a>
<span class="sourceLineNo">5132</span>        int rangeAxisCount = getRangeAxisCount();<a name="line.5132"></a>
<span class="sourceLineNo">5133</span>        for (int i = 0; i &lt; rangeAxisCount; i++) {<a name="line.5133"></a>
<span class="sourceLineNo">5134</span>            ValueAxis axis = getRangeAxis(i);<a name="line.5134"></a>
<span class="sourceLineNo">5135</span>            if (axis == null) {<a name="line.5135"></a>
<span class="sourceLineNo">5136</span>                continue;<a name="line.5136"></a>
<span class="sourceLineNo">5137</span>            }<a name="line.5137"></a>
<span class="sourceLineNo">5138</span>            if (axis.isInverted()) {<a name="line.5138"></a>
<span class="sourceLineNo">5139</span>                percent = -percent;<a name="line.5139"></a>
<span class="sourceLineNo">5140</span>            }<a name="line.5140"></a>
<span class="sourceLineNo">5141</span>            axis.pan(percent);<a name="line.5141"></a>
<span class="sourceLineNo">5142</span>        }<a name="line.5142"></a>
<span class="sourceLineNo">5143</span>    }<a name="line.5143"></a>
<span class="sourceLineNo">5144</span><a name="line.5144"></a>
<span class="sourceLineNo">5145</span>    /**<a name="line.5145"></a>
<span class="sourceLineNo">5146</span>     * Multiplies the range on the domain axis/axes by the specified factor.<a name="line.5146"></a>
<span class="sourceLineNo">5147</span>     *<a name="line.5147"></a>
<span class="sourceLineNo">5148</span>     * @param factor  the zoom factor.<a name="line.5148"></a>
<span class="sourceLineNo">5149</span>     * @param info  the plot rendering info.<a name="line.5149"></a>
<span class="sourceLineNo">5150</span>     * @param source  the source point (in Java2D space).<a name="line.5150"></a>
<span class="sourceLineNo">5151</span>     *<a name="line.5151"></a>
<span class="sourceLineNo">5152</span>     * @see #zoomRangeAxes(double, PlotRenderingInfo, Point2D)<a name="line.5152"></a>
<span class="sourceLineNo">5153</span>     */<a name="line.5153"></a>
<span class="sourceLineNo">5154</span>    public void zoomDomainAxes(double factor, PlotRenderingInfo info,<a name="line.5154"></a>
<span class="sourceLineNo">5155</span>                               Point2D source) {<a name="line.5155"></a>
<span class="sourceLineNo">5156</span>        // delegate to other method<a name="line.5156"></a>
<span class="sourceLineNo">5157</span>        zoomDomainAxes(factor, info, source, false);<a name="line.5157"></a>
<span class="sourceLineNo">5158</span>    }<a name="line.5158"></a>
<span class="sourceLineNo">5159</span><a name="line.5159"></a>
<span class="sourceLineNo">5160</span>    /**<a name="line.5160"></a>
<span class="sourceLineNo">5161</span>     * Multiplies the range on the domain axis/axes by the specified factor.<a name="line.5161"></a>
<span class="sourceLineNo">5162</span>     *<a name="line.5162"></a>
<span class="sourceLineNo">5163</span>     * @param factor  the zoom factor.<a name="line.5163"></a>
<span class="sourceLineNo">5164</span>     * @param info  the plot rendering info.<a name="line.5164"></a>
<span class="sourceLineNo">5165</span>     * @param source  the source point (in Java2D space).<a name="line.5165"></a>
<span class="sourceLineNo">5166</span>     * @param useAnchor  use source point as zoom anchor?<a name="line.5166"></a>
<span class="sourceLineNo">5167</span>     *<a name="line.5167"></a>
<span class="sourceLineNo">5168</span>     * @see #zoomRangeAxes(double, PlotRenderingInfo, Point2D, boolean)<a name="line.5168"></a>
<span class="sourceLineNo">5169</span>     *<a name="line.5169"></a>
<span class="sourceLineNo">5170</span>     * @since 1.0.7<a name="line.5170"></a>
<span class="sourceLineNo">5171</span>     */<a name="line.5171"></a>
<span class="sourceLineNo">5172</span>    public void zoomDomainAxes(double factor, PlotRenderingInfo info,<a name="line.5172"></a>
<span class="sourceLineNo">5173</span>                               Point2D source, boolean useAnchor) {<a name="line.5173"></a>
<span class="sourceLineNo">5174</span><a name="line.5174"></a>
<span class="sourceLineNo">5175</span>        // perform the zoom on each domain axis<a name="line.5175"></a>
<span class="sourceLineNo">5176</span>        for (int i = 0; i &lt; this.domainAxes.size(); i++) {<a name="line.5176"></a>
<span class="sourceLineNo">5177</span>            ValueAxis domainAxis = (ValueAxis) this.domainAxes.get(i);<a name="line.5177"></a>
<span class="sourceLineNo">5178</span>            if (domainAxis != null) {<a name="line.5178"></a>
<span class="sourceLineNo">5179</span>                if (useAnchor) {<a name="line.5179"></a>
<span class="sourceLineNo">5180</span>                    // get the relevant source coordinate given the plot<a name="line.5180"></a>
<span class="sourceLineNo">5181</span>                    // orientation<a name="line.5181"></a>
<span class="sourceLineNo">5182</span>                    double sourceX = source.getX();<a name="line.5182"></a>
<span class="sourceLineNo">5183</span>                    if (this.orientation == PlotOrientation.HORIZONTAL) {<a name="line.5183"></a>
<span class="sourceLineNo">5184</span>                        sourceX = source.getY();<a name="line.5184"></a>
<span class="sourceLineNo">5185</span>                    }<a name="line.5185"></a>
<span class="sourceLineNo">5186</span>                    double anchorX = domainAxis.java2DToValue(sourceX,<a name="line.5186"></a>
<span class="sourceLineNo">5187</span>                            info.getDataArea(), getDomainAxisEdge());<a name="line.5187"></a>
<span class="sourceLineNo">5188</span>                    domainAxis.resizeRange2(factor, anchorX);<a name="line.5188"></a>
<span class="sourceLineNo">5189</span>                }<a name="line.5189"></a>
<span class="sourceLineNo">5190</span>                else {<a name="line.5190"></a>
<span class="sourceLineNo">5191</span>                    domainAxis.resizeRange(factor);<a name="line.5191"></a>
<span class="sourceLineNo">5192</span>                }<a name="line.5192"></a>
<span class="sourceLineNo">5193</span>            }<a name="line.5193"></a>
<span class="sourceLineNo">5194</span>        }<a name="line.5194"></a>
<span class="sourceLineNo">5195</span>    }<a name="line.5195"></a>
<span class="sourceLineNo">5196</span><a name="line.5196"></a>
<span class="sourceLineNo">5197</span>    /**<a name="line.5197"></a>
<span class="sourceLineNo">5198</span>     * Zooms in on the domain axis/axes.  The new lower and upper bounds are<a name="line.5198"></a>
<span class="sourceLineNo">5199</span>     * specified as percentages of the current axis range, where 0 percent is<a name="line.5199"></a>
<span class="sourceLineNo">5200</span>     * the current lower bound and 100 percent is the current upper bound.<a name="line.5200"></a>
<span class="sourceLineNo">5201</span>     *<a name="line.5201"></a>
<span class="sourceLineNo">5202</span>     * @param lowerPercent  a percentage that determines the new lower bound<a name="line.5202"></a>
<span class="sourceLineNo">5203</span>     *                      for the axis (e.g. 0.20 is twenty percent).<a name="line.5203"></a>
<span class="sourceLineNo">5204</span>     * @param upperPercent  a percentage that determines the new upper bound<a name="line.5204"></a>
<span class="sourceLineNo">5205</span>     *                      for the axis (e.g. 0.80 is eighty percent).<a name="line.5205"></a>
<span class="sourceLineNo">5206</span>     * @param info  the plot rendering info.<a name="line.5206"></a>
<span class="sourceLineNo">5207</span>     * @param source  the source point (ignored).<a name="line.5207"></a>
<span class="sourceLineNo">5208</span>     *<a name="line.5208"></a>
<span class="sourceLineNo">5209</span>     * @see #zoomRangeAxes(double, double, PlotRenderingInfo, Point2D)<a name="line.5209"></a>
<span class="sourceLineNo">5210</span>     */<a name="line.5210"></a>
<span class="sourceLineNo">5211</span>    public void zoomDomainAxes(double lowerPercent, double upperPercent,<a name="line.5211"></a>
<span class="sourceLineNo">5212</span>                               PlotRenderingInfo info, Point2D source) {<a name="line.5212"></a>
<span class="sourceLineNo">5213</span>        for (int i = 0; i &lt; this.domainAxes.size(); i++) {<a name="line.5213"></a>
<span class="sourceLineNo">5214</span>            ValueAxis domainAxis = (ValueAxis) this.domainAxes.get(i);<a name="line.5214"></a>
<span class="sourceLineNo">5215</span>            if (domainAxis != null) {<a name="line.5215"></a>
<span class="sourceLineNo">5216</span>                domainAxis.zoomRange(lowerPercent, upperPercent);<a name="line.5216"></a>
<span class="sourceLineNo">5217</span>            }<a name="line.5217"></a>
<span class="sourceLineNo">5218</span>        }<a name="line.5218"></a>
<span class="sourceLineNo">5219</span>    }<a name="line.5219"></a>
<span class="sourceLineNo">5220</span><a name="line.5220"></a>
<span class="sourceLineNo">5221</span>    /**<a name="line.5221"></a>
<span class="sourceLineNo">5222</span>     * Multiplies the range on the range axis/axes by the specified factor.<a name="line.5222"></a>
<span class="sourceLineNo">5223</span>     *<a name="line.5223"></a>
<span class="sourceLineNo">5224</span>     * @param factor  the zoom factor.<a name="line.5224"></a>
<span class="sourceLineNo">5225</span>     * @param info  the plot rendering info.<a name="line.5225"></a>
<span class="sourceLineNo">5226</span>     * @param source  the source point.<a name="line.5226"></a>
<span class="sourceLineNo">5227</span>     *<a name="line.5227"></a>
<span class="sourceLineNo">5228</span>     * @see #zoomDomainAxes(double, PlotRenderingInfo, Point2D, boolean)<a name="line.5228"></a>
<span class="sourceLineNo">5229</span>     */<a name="line.5229"></a>
<span class="sourceLineNo">5230</span>    public void zoomRangeAxes(double factor, PlotRenderingInfo info,<a name="line.5230"></a>
<span class="sourceLineNo">5231</span>                              Point2D source) {<a name="line.5231"></a>
<span class="sourceLineNo">5232</span>        // delegate to other method<a name="line.5232"></a>
<span class="sourceLineNo">5233</span>        zoomRangeAxes(factor, info, source, false);<a name="line.5233"></a>
<span class="sourceLineNo">5234</span>    }<a name="line.5234"></a>
<span class="sourceLineNo">5235</span><a name="line.5235"></a>
<span class="sourceLineNo">5236</span>    /**<a name="line.5236"></a>
<span class="sourceLineNo">5237</span>     * Multiplies the range on the range axis/axes by the specified factor.<a name="line.5237"></a>
<span class="sourceLineNo">5238</span>     *<a name="line.5238"></a>
<span class="sourceLineNo">5239</span>     * @param factor  the zoom factor.<a name="line.5239"></a>
<span class="sourceLineNo">5240</span>     * @param info  the plot rendering info.<a name="line.5240"></a>
<span class="sourceLineNo">5241</span>     * @param source  the source point.<a name="line.5241"></a>
<span class="sourceLineNo">5242</span>     * @param useAnchor  a flag that controls whether or not the source point<a name="line.5242"></a>
<span class="sourceLineNo">5243</span>     *         is used for the zoom anchor.<a name="line.5243"></a>
<span class="sourceLineNo">5244</span>     *<a name="line.5244"></a>
<span class="sourceLineNo">5245</span>     * @see #zoomDomainAxes(double, PlotRenderingInfo, Point2D, boolean)<a name="line.5245"></a>
<span class="sourceLineNo">5246</span>     *<a name="line.5246"></a>
<span class="sourceLineNo">5247</span>     * @since 1.0.7<a name="line.5247"></a>
<span class="sourceLineNo">5248</span>     */<a name="line.5248"></a>
<span class="sourceLineNo">5249</span>    public void zoomRangeAxes(double factor, PlotRenderingInfo info,<a name="line.5249"></a>
<span class="sourceLineNo">5250</span>                              Point2D source, boolean useAnchor) {<a name="line.5250"></a>
<span class="sourceLineNo">5251</span><a name="line.5251"></a>
<span class="sourceLineNo">5252</span>        // perform the zoom on each range axis<a name="line.5252"></a>
<span class="sourceLineNo">5253</span>        for (int i = 0; i &lt; this.rangeAxes.size(); i++) {<a name="line.5253"></a>
<span class="sourceLineNo">5254</span>            ValueAxis rangeAxis = (ValueAxis) this.rangeAxes.get(i);<a name="line.5254"></a>
<span class="sourceLineNo">5255</span>            if (rangeAxis != null) {<a name="line.5255"></a>
<span class="sourceLineNo">5256</span>                if (useAnchor) {<a name="line.5256"></a>
<span class="sourceLineNo">5257</span>                    // get the relevant source coordinate given the plot<a name="line.5257"></a>
<span class="sourceLineNo">5258</span>                    // orientation<a name="line.5258"></a>
<span class="sourceLineNo">5259</span>                    double sourceY = source.getY();<a name="line.5259"></a>
<span class="sourceLineNo">5260</span>                    if (this.orientation == PlotOrientation.HORIZONTAL) {<a name="line.5260"></a>
<span class="sourceLineNo">5261</span>                        sourceY = source.getX();<a name="line.5261"></a>
<span class="sourceLineNo">5262</span>                    }<a name="line.5262"></a>
<span class="sourceLineNo">5263</span>                    double anchorY = rangeAxis.java2DToValue(sourceY,<a name="line.5263"></a>
<span class="sourceLineNo">5264</span>                            info.getDataArea(), getRangeAxisEdge());<a name="line.5264"></a>
<span class="sourceLineNo">5265</span>                    rangeAxis.resizeRange2(factor, anchorY);<a name="line.5265"></a>
<span class="sourceLineNo">5266</span>                }<a name="line.5266"></a>
<span class="sourceLineNo">5267</span>                else {<a name="line.5267"></a>
<span class="sourceLineNo">5268</span>                    rangeAxis.resizeRange(factor);<a name="line.5268"></a>
<span class="sourceLineNo">5269</span>                }<a name="line.5269"></a>
<span class="sourceLineNo">5270</span>            }<a name="line.5270"></a>
<span class="sourceLineNo">5271</span>        }<a name="line.5271"></a>
<span class="sourceLineNo">5272</span>    }<a name="line.5272"></a>
<span class="sourceLineNo">5273</span><a name="line.5273"></a>
<span class="sourceLineNo">5274</span>    /**<a name="line.5274"></a>
<span class="sourceLineNo">5275</span>     * Zooms in on the range axes.<a name="line.5275"></a>
<span class="sourceLineNo">5276</span>     *<a name="line.5276"></a>
<span class="sourceLineNo">5277</span>     * @param lowerPercent  the lower bound.<a name="line.5277"></a>
<span class="sourceLineNo">5278</span>     * @param upperPercent  the upper bound.<a name="line.5278"></a>
<span class="sourceLineNo">5279</span>     * @param info  the plot rendering info.<a name="line.5279"></a>
<span class="sourceLineNo">5280</span>     * @param source  the source point.<a name="line.5280"></a>
<span class="sourceLineNo">5281</span>     *<a name="line.5281"></a>
<span class="sourceLineNo">5282</span>     * @see #zoomDomainAxes(double, double, PlotRenderingInfo, Point2D)<a name="line.5282"></a>
<span class="sourceLineNo">5283</span>     */<a name="line.5283"></a>
<span class="sourceLineNo">5284</span>    public void zoomRangeAxes(double lowerPercent, double upperPercent,<a name="line.5284"></a>
<span class="sourceLineNo">5285</span>                              PlotRenderingInfo info, Point2D source) {<a name="line.5285"></a>
<span class="sourceLineNo">5286</span>        for (int i = 0; i &lt; this.rangeAxes.size(); i++) {<a name="line.5286"></a>
<span class="sourceLineNo">5287</span>            ValueAxis rangeAxis = (ValueAxis) this.rangeAxes.get(i);<a name="line.5287"></a>
<span class="sourceLineNo">5288</span>            if (rangeAxis != null) {<a name="line.5288"></a>
<span class="sourceLineNo">5289</span>                rangeAxis.zoomRange(lowerPercent, upperPercent);<a name="line.5289"></a>
<span class="sourceLineNo">5290</span>            }<a name="line.5290"></a>
<span class="sourceLineNo">5291</span>        }<a name="line.5291"></a>
<span class="sourceLineNo">5292</span>    }<a name="line.5292"></a>
<span class="sourceLineNo">5293</span><a name="line.5293"></a>
<span class="sourceLineNo">5294</span>    /**<a name="line.5294"></a>
<span class="sourceLineNo">5295</span>     * Returns &lt;code&gt;true&lt;/code&gt;, indicating that the domain axis/axes for this<a name="line.5295"></a>
<span class="sourceLineNo">5296</span>     * plot are zoomable.<a name="line.5296"></a>
<span class="sourceLineNo">5297</span>     *<a name="line.5297"></a>
<span class="sourceLineNo">5298</span>     * @return A boolean.<a name="line.5298"></a>
<span class="sourceLineNo">5299</span>     *<a name="line.5299"></a>
<span class="sourceLineNo">5300</span>     * @see #isRangeZoomable()<a name="line.5300"></a>
<span class="sourceLineNo">5301</span>     */<a name="line.5301"></a>
<span class="sourceLineNo">5302</span>    public boolean isDomainZoomable() {<a name="line.5302"></a>
<span class="sourceLineNo">5303</span>        return true;<a name="line.5303"></a>
<span class="sourceLineNo">5304</span>    }<a name="line.5304"></a>
<span class="sourceLineNo">5305</span><a name="line.5305"></a>
<span class="sourceLineNo">5306</span>    /**<a name="line.5306"></a>
<span class="sourceLineNo">5307</span>     * Returns &lt;code&gt;true&lt;/code&gt;, indicating that the range axis/axes for this<a name="line.5307"></a>
<span class="sourceLineNo">5308</span>     * plot are zoomable.<a name="line.5308"></a>
<span class="sourceLineNo">5309</span>     *<a name="line.5309"></a>
<span class="sourceLineNo">5310</span>     * @return A boolean.<a name="line.5310"></a>
<span class="sourceLineNo">5311</span>     *<a name="line.5311"></a>
<span class="sourceLineNo">5312</span>     * @see #isDomainZoomable()<a name="line.5312"></a>
<span class="sourceLineNo">5313</span>     */<a name="line.5313"></a>
<span class="sourceLineNo">5314</span>    public boolean isRangeZoomable() {<a name="line.5314"></a>
<span class="sourceLineNo">5315</span>        return true;<a name="line.5315"></a>
<span class="sourceLineNo">5316</span>    }<a name="line.5316"></a>
<span class="sourceLineNo">5317</span><a name="line.5317"></a>
<span class="sourceLineNo">5318</span>    /**<a name="line.5318"></a>
<span class="sourceLineNo">5319</span>     * Returns the number of series in the primary dataset for this plot.  If<a name="line.5319"></a>
<span class="sourceLineNo">5320</span>     * the dataset is &lt;code&gt;null&lt;/code&gt;, the method returns 0.<a name="line.5320"></a>
<span class="sourceLineNo">5321</span>     *<a name="line.5321"></a>
<span class="sourceLineNo">5322</span>     * @return The series count.<a name="line.5322"></a>
<span class="sourceLineNo">5323</span>     */<a name="line.5323"></a>
<span class="sourceLineNo">5324</span>    public int getSeriesCount() {<a name="line.5324"></a>
<span class="sourceLineNo">5325</span>        int result = 0;<a name="line.5325"></a>
<span class="sourceLineNo">5326</span>        XYDataset dataset = getDataset();<a name="line.5326"></a>
<span class="sourceLineNo">5327</span>        if (dataset != null) {<a name="line.5327"></a>
<span class="sourceLineNo">5328</span>            result = dataset.getSeriesCount();<a name="line.5328"></a>
<span class="sourceLineNo">5329</span>        }<a name="line.5329"></a>
<span class="sourceLineNo">5330</span>        return result;<a name="line.5330"></a>
<span class="sourceLineNo">5331</span>    }<a name="line.5331"></a>
<span class="sourceLineNo">5332</span><a name="line.5332"></a>
<span class="sourceLineNo">5333</span>    /**<a name="line.5333"></a>
<span class="sourceLineNo">5334</span>     * Returns the fixed legend items, if any.<a name="line.5334"></a>
<span class="sourceLineNo">5335</span>     *<a name="line.5335"></a>
<span class="sourceLineNo">5336</span>     * @return The legend items (possibly &lt;code&gt;null&lt;/code&gt;).<a name="line.5336"></a>
<span class="sourceLineNo">5337</span>     *<a name="line.5337"></a>
<span class="sourceLineNo">5338</span>     * @see #setFixedLegendItems(LegendItemCollection)<a name="line.5338"></a>
<span class="sourceLineNo">5339</span>     */<a name="line.5339"></a>
<span class="sourceLineNo">5340</span>    public LegendItemCollection getFixedLegendItems() {<a name="line.5340"></a>
<span class="sourceLineNo">5341</span>        return this.fixedLegendItems;<a name="line.5341"></a>
<span class="sourceLineNo">5342</span>    }<a name="line.5342"></a>
<span class="sourceLineNo">5343</span><a name="line.5343"></a>
<span class="sourceLineNo">5344</span>    /**<a name="line.5344"></a>
<span class="sourceLineNo">5345</span>     * Sets the fixed legend items for the plot.  Leave this set to<a name="line.5345"></a>
<span class="sourceLineNo">5346</span>     * &lt;code&gt;null&lt;/code&gt; if you prefer the legend items to be created<a name="line.5346"></a>
<span class="sourceLineNo">5347</span>     * automatically.<a name="line.5347"></a>
<span class="sourceLineNo">5348</span>     *<a name="line.5348"></a>
<span class="sourceLineNo">5349</span>     * @param items  the legend items (&lt;code&gt;null&lt;/code&gt; permitted).<a name="line.5349"></a>
<span class="sourceLineNo">5350</span>     *<a name="line.5350"></a>
<span class="sourceLineNo">5351</span>     * @see #getFixedLegendItems()<a name="line.5351"></a>
<span class="sourceLineNo">5352</span>     */<a name="line.5352"></a>
<span class="sourceLineNo">5353</span>    public void setFixedLegendItems(LegendItemCollection items) {<a name="line.5353"></a>
<span class="sourceLineNo">5354</span>        this.fixedLegendItems = items;<a name="line.5354"></a>
<span class="sourceLineNo">5355</span>        fireChangeEvent();<a name="line.5355"></a>
<span class="sourceLineNo">5356</span>    }<a name="line.5356"></a>
<span class="sourceLineNo">5357</span><a name="line.5357"></a>
<span class="sourceLineNo">5358</span>    /**<a name="line.5358"></a>
<span class="sourceLineNo">5359</span>     * Returns the legend items for the plot.  Each legend item is generated by<a name="line.5359"></a>
<span class="sourceLineNo">5360</span>     * the plot's renderer, since the renderer is responsible for the visual<a name="line.5360"></a>
<span class="sourceLineNo">5361</span>     * representation of the data.<a name="line.5361"></a>
<span class="sourceLineNo">5362</span>     *<a name="line.5362"></a>
<span class="sourceLineNo">5363</span>     * @return The legend items.<a name="line.5363"></a>
<span class="sourceLineNo">5364</span>     */<a name="line.5364"></a>
<span class="sourceLineNo">5365</span>    public LegendItemCollection getLegendItems() {<a name="line.5365"></a>
<span class="sourceLineNo">5366</span>        if (this.fixedLegendItems != null) {<a name="line.5366"></a>
<span class="sourceLineNo">5367</span>            return this.fixedLegendItems;<a name="line.5367"></a>
<span class="sourceLineNo">5368</span>        }<a name="line.5368"></a>
<span class="sourceLineNo">5369</span>        LegendItemCollection result = new LegendItemCollection();<a name="line.5369"></a>
<span class="sourceLineNo">5370</span>        int count = this.datasets.size();<a name="line.5370"></a>
<span class="sourceLineNo">5371</span>        for (int datasetIndex = 0; datasetIndex &lt; count; datasetIndex++) {<a name="line.5371"></a>
<span class="sourceLineNo">5372</span>            XYDataset dataset = getDataset(datasetIndex);<a name="line.5372"></a>
<span class="sourceLineNo">5373</span>            if (dataset != null) {<a name="line.5373"></a>
<span class="sourceLineNo">5374</span>                XYItemRenderer renderer = getRenderer(datasetIndex);<a name="line.5374"></a>
<span class="sourceLineNo">5375</span>                if (renderer == null) {<a name="line.5375"></a>
<span class="sourceLineNo">5376</span>                    renderer = getRenderer(0);<a name="line.5376"></a>
<span class="sourceLineNo">5377</span>                }<a name="line.5377"></a>
<span class="sourceLineNo">5378</span>                if (renderer != null) {<a name="line.5378"></a>
<span class="sourceLineNo">5379</span>                    int seriesCount = dataset.getSeriesCount();<a name="line.5379"></a>
<span class="sourceLineNo">5380</span>                    for (int i = 0; i &lt; seriesCount; i++) {<a name="line.5380"></a>
<span class="sourceLineNo">5381</span>                        if (renderer.isSeriesVisible(i)<a name="line.5381"></a>
<span class="sourceLineNo">5382</span>                                &amp;&amp; renderer.isSeriesVisibleInLegend(i)) {<a name="line.5382"></a>
<span class="sourceLineNo">5383</span>                            LegendItem item = renderer.getLegendItem(<a name="line.5383"></a>
<span class="sourceLineNo">5384</span>                                    datasetIndex, i);<a name="line.5384"></a>
<span class="sourceLineNo">5385</span>                            if (item != null) {<a name="line.5385"></a>
<span class="sourceLineNo">5386</span>                                result.add(item);<a name="line.5386"></a>
<span class="sourceLineNo">5387</span>                            }<a name="line.5387"></a>
<span class="sourceLineNo">5388</span>                        }<a name="line.5388"></a>
<span class="sourceLineNo">5389</span>                    }<a name="line.5389"></a>
<span class="sourceLineNo">5390</span>                }<a name="line.5390"></a>
<span class="sourceLineNo">5391</span>            }<a name="line.5391"></a>
<span class="sourceLineNo">5392</span>        }<a name="line.5392"></a>
<span class="sourceLineNo">5393</span>        return result;<a name="line.5393"></a>
<span class="sourceLineNo">5394</span>    }<a name="line.5394"></a>
<span class="sourceLineNo">5395</span><a name="line.5395"></a>
<span class="sourceLineNo">5396</span>    /**<a name="line.5396"></a>
<span class="sourceLineNo">5397</span>     * Tests this plot for equality with another object.<a name="line.5397"></a>
<span class="sourceLineNo">5398</span>     *<a name="line.5398"></a>
<span class="sourceLineNo">5399</span>     * @param obj  the object (&lt;code&gt;null&lt;/code&gt; permitted).<a name="line.5399"></a>
<span class="sourceLineNo">5400</span>     *<a name="line.5400"></a>
<span class="sourceLineNo">5401</span>     * @return &lt;code&gt;true&lt;/code&gt; or &lt;code&gt;false&lt;/code&gt;.<a name="line.5401"></a>
<span class="sourceLineNo">5402</span>     */<a name="line.5402"></a>
<span class="sourceLineNo">5403</span>    public boolean equals(Object obj) {<a name="line.5403"></a>
<span class="sourceLineNo">5404</span>        if (obj == this) {<a name="line.5404"></a>
<span class="sourceLineNo">5405</span>            return true;<a name="line.5405"></a>
<span class="sourceLineNo">5406</span>        }<a name="line.5406"></a>
<span class="sourceLineNo">5407</span>        if (!(obj instanceof XYPlot)) {<a name="line.5407"></a>
<span class="sourceLineNo">5408</span>            return false;<a name="line.5408"></a>
<span class="sourceLineNo">5409</span>        }<a name="line.5409"></a>
<span class="sourceLineNo">5410</span>        XYPlot that = (XYPlot) obj;<a name="line.5410"></a>
<span class="sourceLineNo">5411</span>        if (this.weight != that.weight) {<a name="line.5411"></a>
<span class="sourceLineNo">5412</span>            return false;<a name="line.5412"></a>
<span class="sourceLineNo">5413</span>        }<a name="line.5413"></a>
<span class="sourceLineNo">5414</span>        if (this.orientation != that.orientation) {<a name="line.5414"></a>
<span class="sourceLineNo">5415</span>            return false;<a name="line.5415"></a>
<span class="sourceLineNo">5416</span>        }<a name="line.5416"></a>
<span class="sourceLineNo">5417</span>        if (!this.domainAxes.equals(that.domainAxes)) {<a name="line.5417"></a>
<span class="sourceLineNo">5418</span>            return false;<a name="line.5418"></a>
<span class="sourceLineNo">5419</span>        }<a name="line.5419"></a>
<span class="sourceLineNo">5420</span>        if (!this.domainAxisLocations.equals(that.domainAxisLocations)) {<a name="line.5420"></a>
<span class="sourceLineNo">5421</span>            return false;<a name="line.5421"></a>
<span class="sourceLineNo">5422</span>        }<a name="line.5422"></a>
<span class="sourceLineNo">5423</span>        if (this.rangeCrosshairLockedOnData<a name="line.5423"></a>
<span class="sourceLineNo">5424</span>                != that.rangeCrosshairLockedOnData) {<a name="line.5424"></a>
<span class="sourceLineNo">5425</span>            return false;<a name="line.5425"></a>
<span class="sourceLineNo">5426</span>        }<a name="line.5426"></a>
<span class="sourceLineNo">5427</span>        if (this.domainGridlinesVisible != that.domainGridlinesVisible) {<a name="line.5427"></a>
<span class="sourceLineNo">5428</span>            return false;<a name="line.5428"></a>
<span class="sourceLineNo">5429</span>        }<a name="line.5429"></a>
<span class="sourceLineNo">5430</span>        if (this.rangeGridlinesVisible != that.rangeGridlinesVisible) {<a name="line.5430"></a>
<span class="sourceLineNo">5431</span>            return false;<a name="line.5431"></a>
<span class="sourceLineNo">5432</span>        }<a name="line.5432"></a>
<span class="sourceLineNo">5433</span>        if (this.domainMinorGridlinesVisible<a name="line.5433"></a>
<span class="sourceLineNo">5434</span>                != that.domainMinorGridlinesVisible) {<a name="line.5434"></a>
<span class="sourceLineNo">5435</span>            return false;<a name="line.5435"></a>
<span class="sourceLineNo">5436</span>        }<a name="line.5436"></a>
<span class="sourceLineNo">5437</span>        if (this.rangeMinorGridlinesVisible<a name="line.5437"></a>
<span class="sourceLineNo">5438</span>                != that.rangeMinorGridlinesVisible) {<a name="line.5438"></a>
<span class="sourceLineNo">5439</span>            return false;<a name="line.5439"></a>
<span class="sourceLineNo">5440</span>        }<a name="line.5440"></a>
<span class="sourceLineNo">5441</span>        if (this.domainZeroBaselineVisible != that.domainZeroBaselineVisible) {<a name="line.5441"></a>
<span class="sourceLineNo">5442</span>            return false;<a name="line.5442"></a>
<span class="sourceLineNo">5443</span>        }<a name="line.5443"></a>
<span class="sourceLineNo">5444</span>        if (this.rangeZeroBaselineVisible != that.rangeZeroBaselineVisible) {<a name="line.5444"></a>
<span class="sourceLineNo">5445</span>            return false;<a name="line.5445"></a>
<span class="sourceLineNo">5446</span>        }<a name="line.5446"></a>
<span class="sourceLineNo">5447</span>        if (this.domainCrosshairVisible != that.domainCrosshairVisible) {<a name="line.5447"></a>
<span class="sourceLineNo">5448</span>            return false;<a name="line.5448"></a>
<span class="sourceLineNo">5449</span>        }<a name="line.5449"></a>
<span class="sourceLineNo">5450</span>        if (this.domainCrosshairValue != that.domainCrosshairValue) {<a name="line.5450"></a>
<span class="sourceLineNo">5451</span>            return false;<a name="line.5451"></a>
<span class="sourceLineNo">5452</span>        }<a name="line.5452"></a>
<span class="sourceLineNo">5453</span>        if (this.domainCrosshairLockedOnData<a name="line.5453"></a>
<span class="sourceLineNo">5454</span>                != that.domainCrosshairLockedOnData) {<a name="line.5454"></a>
<span class="sourceLineNo">5455</span>            return false;<a name="line.5455"></a>
<span class="sourceLineNo">5456</span>        }<a name="line.5456"></a>
<span class="sourceLineNo">5457</span>        if (this.rangeCrosshairVisible != that.rangeCrosshairVisible) {<a name="line.5457"></a>
<span class="sourceLineNo">5458</span>            return false;<a name="line.5458"></a>
<span class="sourceLineNo">5459</span>        }<a name="line.5459"></a>
<span class="sourceLineNo">5460</span>        if (this.rangeCrosshairValue != that.rangeCrosshairValue) {<a name="line.5460"></a>
<span class="sourceLineNo">5461</span>            return false;<a name="line.5461"></a>
<span class="sourceLineNo">5462</span>        }<a name="line.5462"></a>
<span class="sourceLineNo">5463</span>        if (!ObjectUtilities.equal(this.axisOffset, that.axisOffset)) {<a name="line.5463"></a>
<span class="sourceLineNo">5464</span>            return false;<a name="line.5464"></a>
<span class="sourceLineNo">5465</span>        }<a name="line.5465"></a>
<span class="sourceLineNo">5466</span>        if (!ObjectUtilities.equal(this.renderers, that.renderers)) {<a name="line.5466"></a>
<span class="sourceLineNo">5467</span>            return false;<a name="line.5467"></a>
<span class="sourceLineNo">5468</span>        }<a name="line.5468"></a>
<span class="sourceLineNo">5469</span>        if (!ObjectUtilities.equal(this.rangeAxes, that.rangeAxes)) {<a name="line.5469"></a>
<span class="sourceLineNo">5470</span>            return false;<a name="line.5470"></a>
<span class="sourceLineNo">5471</span>        }<a name="line.5471"></a>
<span class="sourceLineNo">5472</span>        if (!this.rangeAxisLocations.equals(that.rangeAxisLocations)) {<a name="line.5472"></a>
<span class="sourceLineNo">5473</span>            return false;<a name="line.5473"></a>
<span class="sourceLineNo">5474</span>        }<a name="line.5474"></a>
<span class="sourceLineNo">5475</span>        if (!ObjectUtilities.equal(this.datasetToDomainAxesMap,<a name="line.5475"></a>
<span class="sourceLineNo">5476</span>                that.datasetToDomainAxesMap)) {<a name="line.5476"></a>
<span class="sourceLineNo">5477</span>            return false;<a name="line.5477"></a>
<span class="sourceLineNo">5478</span>        }<a name="line.5478"></a>
<span class="sourceLineNo">5479</span>        if (!ObjectUtilities.equal(this.datasetToRangeAxesMap,<a name="line.5479"></a>
<span class="sourceLineNo">5480</span>                that.datasetToRangeAxesMap)) {<a name="line.5480"></a>
<span class="sourceLineNo">5481</span>            return false;<a name="line.5481"></a>
<span class="sourceLineNo">5482</span>        }<a name="line.5482"></a>
<span class="sourceLineNo">5483</span>        if (!ObjectUtilities.equal(this.domainGridlineStroke,<a name="line.5483"></a>
<span class="sourceLineNo">5484</span>                that.domainGridlineStroke)) {<a name="line.5484"></a>
<span class="sourceLineNo">5485</span>            return false;<a name="line.5485"></a>
<span class="sourceLineNo">5486</span>        }<a name="line.5486"></a>
<span class="sourceLineNo">5487</span>        if (!PaintUtilities.equal(this.domainGridlinePaint,<a name="line.5487"></a>
<span class="sourceLineNo">5488</span>                that.domainGridlinePaint)) {<a name="line.5488"></a>
<span class="sourceLineNo">5489</span>            return false;<a name="line.5489"></a>
<span class="sourceLineNo">5490</span>        }<a name="line.5490"></a>
<span class="sourceLineNo">5491</span>        if (!ObjectUtilities.equal(this.rangeGridlineStroke,<a name="line.5491"></a>
<span class="sourceLineNo">5492</span>                that.rangeGridlineStroke)) {<a name="line.5492"></a>
<span class="sourceLineNo">5493</span>            return false;<a name="line.5493"></a>
<span class="sourceLineNo">5494</span>        }<a name="line.5494"></a>
<span class="sourceLineNo">5495</span>        if (!PaintUtilities.equal(this.rangeGridlinePaint,<a name="line.5495"></a>
<span class="sourceLineNo">5496</span>                that.rangeGridlinePaint)) {<a name="line.5496"></a>
<span class="sourceLineNo">5497</span>            return false;<a name="line.5497"></a>
<span class="sourceLineNo">5498</span>        }<a name="line.5498"></a>
<span class="sourceLineNo">5499</span>        if (!ObjectUtilities.equal(this.domainMinorGridlineStroke,<a name="line.5499"></a>
<span class="sourceLineNo">5500</span>                that.domainMinorGridlineStroke)) {<a name="line.5500"></a>
<span class="sourceLineNo">5501</span>            return false;<a name="line.5501"></a>
<span class="sourceLineNo">5502</span>        }<a name="line.5502"></a>
<span class="sourceLineNo">5503</span>        if (!PaintUtilities.equal(this.domainMinorGridlinePaint,<a name="line.5503"></a>
<span class="sourceLineNo">5504</span>                that.domainMinorGridlinePaint)) {<a name="line.5504"></a>
<span class="sourceLineNo">5505</span>            return false;<a name="line.5505"></a>
<span class="sourceLineNo">5506</span>        }<a name="line.5506"></a>
<span class="sourceLineNo">5507</span>        if (!ObjectUtilities.equal(this.rangeMinorGridlineStroke,<a name="line.5507"></a>
<span class="sourceLineNo">5508</span>                that.rangeMinorGridlineStroke)) {<a name="line.5508"></a>
<span class="sourceLineNo">5509</span>            return false;<a name="line.5509"></a>
<span class="sourceLineNo">5510</span>        }<a name="line.5510"></a>
<span class="sourceLineNo">5511</span>        if (!PaintUtilities.equal(this.rangeMinorGridlinePaint,<a name="line.5511"></a>
<span class="sourceLineNo">5512</span>                that.rangeMinorGridlinePaint)) {<a name="line.5512"></a>
<span class="sourceLineNo">5513</span>            return false;<a name="line.5513"></a>
<span class="sourceLineNo">5514</span>        }<a name="line.5514"></a>
<span class="sourceLineNo">5515</span>        if (!PaintUtilities.equal(this.domainZeroBaselinePaint,<a name="line.5515"></a>
<span class="sourceLineNo">5516</span>                that.domainZeroBaselinePaint)) {<a name="line.5516"></a>
<span class="sourceLineNo">5517</span>            return false;<a name="line.5517"></a>
<span class="sourceLineNo">5518</span>        }<a name="line.5518"></a>
<span class="sourceLineNo">5519</span>        if (!ObjectUtilities.equal(this.domainZeroBaselineStroke,<a name="line.5519"></a>
<span class="sourceLineNo">5520</span>                that.domainZeroBaselineStroke)) {<a name="line.5520"></a>
<span class="sourceLineNo">5521</span>            return false;<a name="line.5521"></a>
<span class="sourceLineNo">5522</span>        }<a name="line.5522"></a>
<span class="sourceLineNo">5523</span>        if (!PaintUtilities.equal(this.rangeZeroBaselinePaint,<a name="line.5523"></a>
<span class="sourceLineNo">5524</span>                that.rangeZeroBaselinePaint)) {<a name="line.5524"></a>
<span class="sourceLineNo">5525</span>            return false;<a name="line.5525"></a>
<span class="sourceLineNo">5526</span>        }<a name="line.5526"></a>
<span class="sourceLineNo">5527</span>        if (!ObjectUtilities.equal(this.rangeZeroBaselineStroke,<a name="line.5527"></a>
<span class="sourceLineNo">5528</span>                that.rangeZeroBaselineStroke)) {<a name="line.5528"></a>
<span class="sourceLineNo">5529</span>            return false;<a name="line.5529"></a>
<span class="sourceLineNo">5530</span>        }<a name="line.5530"></a>
<span class="sourceLineNo">5531</span>        if (!ObjectUtilities.equal(this.domainCrosshairStroke,<a name="line.5531"></a>
<span class="sourceLineNo">5532</span>                that.domainCrosshairStroke)) {<a name="line.5532"></a>
<span class="sourceLineNo">5533</span>            return false;<a name="line.5533"></a>
<span class="sourceLineNo">5534</span>        }<a name="line.5534"></a>
<span class="sourceLineNo">5535</span>        if (!PaintUtilities.equal(this.domainCrosshairPaint,<a name="line.5535"></a>
<span class="sourceLineNo">5536</span>                that.domainCrosshairPaint)) {<a name="line.5536"></a>
<span class="sourceLineNo">5537</span>            return false;<a name="line.5537"></a>
<span class="sourceLineNo">5538</span>        }<a name="line.5538"></a>
<span class="sourceLineNo">5539</span>        if (!ObjectUtilities.equal(this.rangeCrosshairStroke,<a name="line.5539"></a>
<span class="sourceLineNo">5540</span>                that.rangeCrosshairStroke)) {<a name="line.5540"></a>
<span class="sourceLineNo">5541</span>            return false;<a name="line.5541"></a>
<span class="sourceLineNo">5542</span>        }<a name="line.5542"></a>
<span class="sourceLineNo">5543</span>        if (!PaintUtilities.equal(this.rangeCrosshairPaint,<a name="line.5543"></a>
<span class="sourceLineNo">5544</span>                that.rangeCrosshairPaint)) {<a name="line.5544"></a>
<span class="sourceLineNo">5545</span>            return false;<a name="line.5545"></a>
<span class="sourceLineNo">5546</span>        }<a name="line.5546"></a>
<span class="sourceLineNo">5547</span>        if (!ObjectUtilities.equal(this.foregroundDomainMarkers,<a name="line.5547"></a>
<span class="sourceLineNo">5548</span>                that.foregroundDomainMarkers)) {<a name="line.5548"></a>
<span class="sourceLineNo">5549</span>            return false;<a name="line.5549"></a>
<span class="sourceLineNo">5550</span>        }<a name="line.5550"></a>
<span class="sourceLineNo">5551</span>        if (!ObjectUtilities.equal(this.backgroundDomainMarkers,<a name="line.5551"></a>
<span class="sourceLineNo">5552</span>                that.backgroundDomainMarkers)) {<a name="line.5552"></a>
<span class="sourceLineNo">5553</span>            return false;<a name="line.5553"></a>
<span class="sourceLineNo">5554</span>        }<a name="line.5554"></a>
<span class="sourceLineNo">5555</span>        if (!ObjectUtilities.equal(this.foregroundRangeMarkers,<a name="line.5555"></a>
<span class="sourceLineNo">5556</span>                that.foregroundRangeMarkers)) {<a name="line.5556"></a>
<span class="sourceLineNo">5557</span>            return false;<a name="line.5557"></a>
<span class="sourceLineNo">5558</span>        }<a name="line.5558"></a>
<span class="sourceLineNo">5559</span>        if (!ObjectUtilities.equal(this.backgroundRangeMarkers,<a name="line.5559"></a>
<span class="sourceLineNo">5560</span>                that.backgroundRangeMarkers)) {<a name="line.5560"></a>
<span class="sourceLineNo">5561</span>            return false;<a name="line.5561"></a>
<span class="sourceLineNo">5562</span>        }<a name="line.5562"></a>
<span class="sourceLineNo">5563</span>        if (!ObjectUtilities.equal(this.foregroundDomainMarkers,<a name="line.5563"></a>
<span class="sourceLineNo">5564</span>                that.foregroundDomainMarkers)) {<a name="line.5564"></a>
<span class="sourceLineNo">5565</span>            return false;<a name="line.5565"></a>
<span class="sourceLineNo">5566</span>        }<a name="line.5566"></a>
<span class="sourceLineNo">5567</span>        if (!ObjectUtilities.equal(this.backgroundDomainMarkers,<a name="line.5567"></a>
<span class="sourceLineNo">5568</span>                that.backgroundDomainMarkers)) {<a name="line.5568"></a>
<span class="sourceLineNo">5569</span>            return false;<a name="line.5569"></a>
<span class="sourceLineNo">5570</span>        }<a name="line.5570"></a>
<span class="sourceLineNo">5571</span>        if (!ObjectUtilities.equal(this.foregroundRangeMarkers,<a name="line.5571"></a>
<span class="sourceLineNo">5572</span>                that.foregroundRangeMarkers)) {<a name="line.5572"></a>
<span class="sourceLineNo">5573</span>            return false;<a name="line.5573"></a>
<span class="sourceLineNo">5574</span>        }<a name="line.5574"></a>
<span class="sourceLineNo">5575</span>        if (!ObjectUtilities.equal(this.backgroundRangeMarkers,<a name="line.5575"></a>
<span class="sourceLineNo">5576</span>                that.backgroundRangeMarkers)) {<a name="line.5576"></a>
<span class="sourceLineNo">5577</span>            return false;<a name="line.5577"></a>
<span class="sourceLineNo">5578</span>        }<a name="line.5578"></a>
<span class="sourceLineNo">5579</span>        if (!ObjectUtilities.equal(this.annotations, that.annotations)) {<a name="line.5579"></a>
<span class="sourceLineNo">5580</span>            return false;<a name="line.5580"></a>
<span class="sourceLineNo">5581</span>        }<a name="line.5581"></a>
<span class="sourceLineNo">5582</span>        if (!ObjectUtilities.equal(this.fixedLegendItems,<a name="line.5582"></a>
<span class="sourceLineNo">5583</span>                that.fixedLegendItems)) {<a name="line.5583"></a>
<span class="sourceLineNo">5584</span>            return false;<a name="line.5584"></a>
<span class="sourceLineNo">5585</span>        }<a name="line.5585"></a>
<span class="sourceLineNo">5586</span>        if (!PaintUtilities.equal(this.domainTickBandPaint,<a name="line.5586"></a>
<span class="sourceLineNo">5587</span>                that.domainTickBandPaint)) {<a name="line.5587"></a>
<span class="sourceLineNo">5588</span>            return false;<a name="line.5588"></a>
<span class="sourceLineNo">5589</span>        }<a name="line.5589"></a>
<span class="sourceLineNo">5590</span>        if (!PaintUtilities.equal(this.rangeTickBandPaint,<a name="line.5590"></a>
<span class="sourceLineNo">5591</span>                that.rangeTickBandPaint)) {<a name="line.5591"></a>
<span class="sourceLineNo">5592</span>            return false;<a name="line.5592"></a>
<span class="sourceLineNo">5593</span>        }<a name="line.5593"></a>
<span class="sourceLineNo">5594</span>        if (!this.quadrantOrigin.equals(that.quadrantOrigin)) {<a name="line.5594"></a>
<span class="sourceLineNo">5595</span>            return false;<a name="line.5595"></a>
<span class="sourceLineNo">5596</span>        }<a name="line.5596"></a>
<span class="sourceLineNo">5597</span>        for (int i = 0; i &lt; 4; i++) {<a name="line.5597"></a>
<span class="sourceLineNo">5598</span>            if (!PaintUtilities.equal(this.quadrantPaint[i],<a name="line.5598"></a>
<span class="sourceLineNo">5599</span>                    that.quadrantPaint[i])) {<a name="line.5599"></a>
<span class="sourceLineNo">5600</span>                return false;<a name="line.5600"></a>
<span class="sourceLineNo">5601</span>            }<a name="line.5601"></a>
<span class="sourceLineNo">5602</span>        }<a name="line.5602"></a>
<span class="sourceLineNo">5603</span>        if (!ObjectUtilities.equal(this.shadowGenerator,<a name="line.5603"></a>
<span class="sourceLineNo">5604</span>                that.shadowGenerator)) {<a name="line.5604"></a>
<span class="sourceLineNo">5605</span>            return false;<a name="line.5605"></a>
<span class="sourceLineNo">5606</span>        }<a name="line.5606"></a>
<span class="sourceLineNo">5607</span>        return super.equals(obj);<a name="line.5607"></a>
<span class="sourceLineNo">5608</span>    }<a name="line.5608"></a>
<span class="sourceLineNo">5609</span><a name="line.5609"></a>
<span class="sourceLineNo">5610</span>    /**<a name="line.5610"></a>
<span class="sourceLineNo">5611</span>     * Returns a clone of the plot.<a name="line.5611"></a>
<span class="sourceLineNo">5612</span>     *<a name="line.5612"></a>
<span class="sourceLineNo">5613</span>     * @return A clone.<a name="line.5613"></a>
<span class="sourceLineNo">5614</span>     *<a name="line.5614"></a>
<span class="sourceLineNo">5615</span>     * @throws CloneNotSupportedException  this can occur if some component of<a name="line.5615"></a>
<span class="sourceLineNo">5616</span>     *         the plot cannot be cloned.<a name="line.5616"></a>
<span class="sourceLineNo">5617</span>     */<a name="line.5617"></a>
<span class="sourceLineNo">5618</span>    public Object clone() throws CloneNotSupportedException {<a name="line.5618"></a>
<span class="sourceLineNo">5619</span><a name="line.5619"></a>
<span class="sourceLineNo">5620</span>        XYPlot clone = (XYPlot) super.clone();<a name="line.5620"></a>
<span class="sourceLineNo">5621</span>        clone.domainAxes = (ObjectList) ObjectUtilities.clone(this.domainAxes);<a name="line.5621"></a>
<span class="sourceLineNo">5622</span>        for (int i = 0; i &lt; this.domainAxes.size(); i++) {<a name="line.5622"></a>
<span class="sourceLineNo">5623</span>            ValueAxis axis = (ValueAxis) this.domainAxes.get(i);<a name="line.5623"></a>
<span class="sourceLineNo">5624</span>            if (axis != null) {<a name="line.5624"></a>
<span class="sourceLineNo">5625</span>                ValueAxis clonedAxis = (ValueAxis) axis.clone();<a name="line.5625"></a>
<span class="sourceLineNo">5626</span>                clone.domainAxes.set(i, clonedAxis);<a name="line.5626"></a>
<span class="sourceLineNo">5627</span>                clonedAxis.setPlot(clone);<a name="line.5627"></a>
<span class="sourceLineNo">5628</span>                clonedAxis.addChangeListener(clone);<a name="line.5628"></a>
<span class="sourceLineNo">5629</span>            }<a name="line.5629"></a>
<span class="sourceLineNo">5630</span>        }<a name="line.5630"></a>
<span class="sourceLineNo">5631</span>        clone.domainAxisLocations = (ObjectList)<a name="line.5631"></a>
<span class="sourceLineNo">5632</span>                this.domainAxisLocations.clone();<a name="line.5632"></a>
<span class="sourceLineNo">5633</span><a name="line.5633"></a>
<span class="sourceLineNo">5634</span>        clone.rangeAxes = (ObjectList) ObjectUtilities.clone(this.rangeAxes);<a name="line.5634"></a>
<span class="sourceLineNo">5635</span>        for (int i = 0; i &lt; this.rangeAxes.size(); i++) {<a name="line.5635"></a>
<span class="sourceLineNo">5636</span>            ValueAxis axis = (ValueAxis) this.rangeAxes.get(i);<a name="line.5636"></a>
<span class="sourceLineNo">5637</span>            if (axis != null) {<a name="line.5637"></a>
<span class="sourceLineNo">5638</span>                ValueAxis clonedAxis = (ValueAxis) axis.clone();<a name="line.5638"></a>
<span class="sourceLineNo">5639</span>                clone.rangeAxes.set(i, clonedAxis);<a name="line.5639"></a>
<span class="sourceLineNo">5640</span>                clonedAxis.setPlot(clone);<a name="line.5640"></a>
<span class="sourceLineNo">5641</span>                clonedAxis.addChangeListener(clone);<a name="line.5641"></a>
<span class="sourceLineNo">5642</span>            }<a name="line.5642"></a>
<span class="sourceLineNo">5643</span>        }<a name="line.5643"></a>
<span class="sourceLineNo">5644</span>        clone.rangeAxisLocations = (ObjectList) ObjectUtilities.clone(<a name="line.5644"></a>
<span class="sourceLineNo">5645</span>                this.rangeAxisLocations);<a name="line.5645"></a>
<span class="sourceLineNo">5646</span><a name="line.5646"></a>
<span class="sourceLineNo">5647</span>        // the datasets are not cloned, but listeners need to be added...<a name="line.5647"></a>
<span class="sourceLineNo">5648</span>        clone.datasets = (ObjectList) ObjectUtilities.clone(this.datasets);<a name="line.5648"></a>
<span class="sourceLineNo">5649</span>        for (int i = 0; i &lt; clone.datasets.size(); ++i) {<a name="line.5649"></a>
<span class="sourceLineNo">5650</span>            XYDataset d = getDataset(i);<a name="line.5650"></a>
<span class="sourceLineNo">5651</span>            if (d != null) {<a name="line.5651"></a>
<span class="sourceLineNo">5652</span>                d.addChangeListener(clone);<a name="line.5652"></a>
<span class="sourceLineNo">5653</span>            }<a name="line.5653"></a>
<span class="sourceLineNo">5654</span>        }<a name="line.5654"></a>
<span class="sourceLineNo">5655</span><a name="line.5655"></a>
<span class="sourceLineNo">5656</span>        clone.datasetToDomainAxesMap = new TreeMap();<a name="line.5656"></a>
<span class="sourceLineNo">5657</span>        clone.datasetToDomainAxesMap.putAll(this.datasetToDomainAxesMap);<a name="line.5657"></a>
<span class="sourceLineNo">5658</span>        clone.datasetToRangeAxesMap = new TreeMap();<a name="line.5658"></a>
<span class="sourceLineNo">5659</span>        clone.datasetToRangeAxesMap.putAll(this.datasetToRangeAxesMap);<a name="line.5659"></a>
<span class="sourceLineNo">5660</span><a name="line.5660"></a>
<span class="sourceLineNo">5661</span>        clone.renderers = (ObjectList) ObjectUtilities.clone(this.renderers);<a name="line.5661"></a>
<span class="sourceLineNo">5662</span>        for (int i = 0; i &lt; this.renderers.size(); i++) {<a name="line.5662"></a>
<span class="sourceLineNo">5663</span>            XYItemRenderer renderer2 = (XYItemRenderer) this.renderers.get(i);<a name="line.5663"></a>
<span class="sourceLineNo">5664</span>            if (renderer2 instanceof PublicCloneable) {<a name="line.5664"></a>
<span class="sourceLineNo">5665</span>                PublicCloneable pc = (PublicCloneable) renderer2;<a name="line.5665"></a>
<span class="sourceLineNo">5666</span>                XYItemRenderer rc = (XYItemRenderer) pc.clone();<a name="line.5666"></a>
<span class="sourceLineNo">5667</span>                clone.renderers.set(i, rc);<a name="line.5667"></a>
<span class="sourceLineNo">5668</span>                rc.setPlot(clone);<a name="line.5668"></a>
<span class="sourceLineNo">5669</span>                rc.addChangeListener(clone);<a name="line.5669"></a>
<span class="sourceLineNo">5670</span>            }<a name="line.5670"></a>
<span class="sourceLineNo">5671</span>        }<a name="line.5671"></a>
<span class="sourceLineNo">5672</span>        clone.foregroundDomainMarkers = (Map) ObjectUtilities.clone(<a name="line.5672"></a>
<span class="sourceLineNo">5673</span>                this.foregroundDomainMarkers);<a name="line.5673"></a>
<span class="sourceLineNo">5674</span>        clone.backgroundDomainMarkers = (Map) ObjectUtilities.clone(<a name="line.5674"></a>
<span class="sourceLineNo">5675</span>                this.backgroundDomainMarkers);<a name="line.5675"></a>
<span class="sourceLineNo">5676</span>        clone.foregroundRangeMarkers = (Map) ObjectUtilities.clone(<a name="line.5676"></a>
<span class="sourceLineNo">5677</span>                this.foregroundRangeMarkers);<a name="line.5677"></a>
<span class="sourceLineNo">5678</span>        clone.backgroundRangeMarkers = (Map) ObjectUtilities.clone(<a name="line.5678"></a>
<span class="sourceLineNo">5679</span>                this.backgroundRangeMarkers);<a name="line.5679"></a>
<span class="sourceLineNo">5680</span>        clone.annotations = (List) ObjectUtilities.deepClone(this.annotations);<a name="line.5680"></a>
<span class="sourceLineNo">5681</span>        if (this.fixedDomainAxisSpace != null) {<a name="line.5681"></a>
<span class="sourceLineNo">5682</span>            clone.fixedDomainAxisSpace = (AxisSpace) ObjectUtilities.clone(<a name="line.5682"></a>
<span class="sourceLineNo">5683</span>                    this.fixedDomainAxisSpace);<a name="line.5683"></a>
<span class="sourceLineNo">5684</span>        }<a name="line.5684"></a>
<span class="sourceLineNo">5685</span>        if (this.fixedRangeAxisSpace != null) {<a name="line.5685"></a>
<span class="sourceLineNo">5686</span>            clone.fixedRangeAxisSpace = (AxisSpace) ObjectUtilities.clone(<a name="line.5686"></a>
<span class="sourceLineNo">5687</span>                    this.fixedRangeAxisSpace);<a name="line.5687"></a>
<span class="sourceLineNo">5688</span>        }<a name="line.5688"></a>
<span class="sourceLineNo">5689</span>        if (this.fixedLegendItems != null) {<a name="line.5689"></a>
<span class="sourceLineNo">5690</span>            clone.fixedLegendItems<a name="line.5690"></a>
<span class="sourceLineNo">5691</span>                    = (LegendItemCollection) this.fixedLegendItems.clone();<a name="line.5691"></a>
<span class="sourceLineNo">5692</span>        }<a name="line.5692"></a>
<span class="sourceLineNo">5693</span>        clone.quadrantOrigin = (Point2D) ObjectUtilities.clone(<a name="line.5693"></a>
<span class="sourceLineNo">5694</span>                this.quadrantOrigin);<a name="line.5694"></a>
<span class="sourceLineNo">5695</span>        clone.quadrantPaint = (Paint[]) this.quadrantPaint.clone();<a name="line.5695"></a>
<span class="sourceLineNo">5696</span>        return clone;<a name="line.5696"></a>
<span class="sourceLineNo">5697</span><a name="line.5697"></a>
<span class="sourceLineNo">5698</span>    }<a name="line.5698"></a>
<span class="sourceLineNo">5699</span><a name="line.5699"></a>
<span class="sourceLineNo">5700</span>    /**<a name="line.5700"></a>
<span class="sourceLineNo">5701</span>     * Provides serialization support.<a name="line.5701"></a>
<span class="sourceLineNo">5702</span>     *<a name="line.5702"></a>
<span class="sourceLineNo">5703</span>     * @param stream  the output stream.<a name="line.5703"></a>
<span class="sourceLineNo">5704</span>     *<a name="line.5704"></a>
<span class="sourceLineNo">5705</span>     * @throws IOException  if there is an I/O error.<a name="line.5705"></a>
<span class="sourceLineNo">5706</span>     */<a name="line.5706"></a>
<span class="sourceLineNo">5707</span>    private void writeObject(ObjectOutputStream stream) throws IOException {<a name="line.5707"></a>
<span class="sourceLineNo">5708</span>        stream.defaultWriteObject();<a name="line.5708"></a>
<span class="sourceLineNo">5709</span>        SerialUtilities.writeStroke(this.domainGridlineStroke, stream);<a name="line.5709"></a>
<span class="sourceLineNo">5710</span>        SerialUtilities.writePaint(this.domainGridlinePaint, stream);<a name="line.5710"></a>
<span class="sourceLineNo">5711</span>        SerialUtilities.writeStroke(this.rangeGridlineStroke, stream);<a name="line.5711"></a>
<span class="sourceLineNo">5712</span>        SerialUtilities.writePaint(this.rangeGridlinePaint, stream);<a name="line.5712"></a>
<span class="sourceLineNo">5713</span>        SerialUtilities.writeStroke(this.domainMinorGridlineStroke, stream);<a name="line.5713"></a>
<span class="sourceLineNo">5714</span>        SerialUtilities.writePaint(this.domainMinorGridlinePaint, stream);<a name="line.5714"></a>
<span class="sourceLineNo">5715</span>        SerialUtilities.writeStroke(this.rangeMinorGridlineStroke, stream);<a name="line.5715"></a>
<span class="sourceLineNo">5716</span>        SerialUtilities.writePaint(this.rangeMinorGridlinePaint, stream);<a name="line.5716"></a>
<span class="sourceLineNo">5717</span>        SerialUtilities.writeStroke(this.rangeZeroBaselineStroke, stream);<a name="line.5717"></a>
<span class="sourceLineNo">5718</span>        SerialUtilities.writePaint(this.rangeZeroBaselinePaint, stream);<a name="line.5718"></a>
<span class="sourceLineNo">5719</span>        SerialUtilities.writeStroke(this.domainCrosshairStroke, stream);<a name="line.5719"></a>
<span class="sourceLineNo">5720</span>        SerialUtilities.writePaint(this.domainCrosshairPaint, stream);<a name="line.5720"></a>
<span class="sourceLineNo">5721</span>        SerialUtilities.writeStroke(this.rangeCrosshairStroke, stream);<a name="line.5721"></a>
<span class="sourceLineNo">5722</span>        SerialUtilities.writePaint(this.rangeCrosshairPaint, stream);<a name="line.5722"></a>
<span class="sourceLineNo">5723</span>        SerialUtilities.writePaint(this.domainTickBandPaint, stream);<a name="line.5723"></a>
<span class="sourceLineNo">5724</span>        SerialUtilities.writePaint(this.rangeTickBandPaint, stream);<a name="line.5724"></a>
<span class="sourceLineNo">5725</span>        SerialUtilities.writePoint2D(this.quadrantOrigin, stream);<a name="line.5725"></a>
<span class="sourceLineNo">5726</span>        for (int i = 0; i &lt; 4; i++) {<a name="line.5726"></a>
<span class="sourceLineNo">5727</span>            SerialUtilities.writePaint(this.quadrantPaint[i], stream);<a name="line.5727"></a>
<span class="sourceLineNo">5728</span>        }<a name="line.5728"></a>
<span class="sourceLineNo">5729</span>        SerialUtilities.writeStroke(this.domainZeroBaselineStroke, stream);<a name="line.5729"></a>
<span class="sourceLineNo">5730</span>        SerialUtilities.writePaint(this.domainZeroBaselinePaint, stream);<a name="line.5730"></a>
<span class="sourceLineNo">5731</span>    }<a name="line.5731"></a>
<span class="sourceLineNo">5732</span><a name="line.5732"></a>
<span class="sourceLineNo">5733</span>    /**<a name="line.5733"></a>
<span class="sourceLineNo">5734</span>     * Provides serialization support.<a name="line.5734"></a>
<span class="sourceLineNo">5735</span>     *<a name="line.5735"></a>
<span class="sourceLineNo">5736</span>     * @param stream  the input stream.<a name="line.5736"></a>
<span class="sourceLineNo">5737</span>     *<a name="line.5737"></a>
<span class="sourceLineNo">5738</span>     * @throws IOException  if there is an I/O error.<a name="line.5738"></a>
<span class="sourceLineNo">5739</span>     * @throws ClassNotFoundException  if there is a classpath problem.<a name="line.5739"></a>
<span class="sourceLineNo">5740</span>     */<a name="line.5740"></a>
<span class="sourceLineNo">5741</span>    private void readObject(ObjectInputStream stream)<a name="line.5741"></a>
<span class="sourceLineNo">5742</span>        throws IOException, ClassNotFoundException {<a name="line.5742"></a>
<span class="sourceLineNo">5743</span><a name="line.5743"></a>
<span class="sourceLineNo">5744</span>        stream.defaultReadObject();<a name="line.5744"></a>
<span class="sourceLineNo">5745</span>        this.domainGridlineStroke = SerialUtilities.readStroke(stream);<a name="line.5745"></a>
<span class="sourceLineNo">5746</span>        this.domainGridlinePaint = SerialUtilities.readPaint(stream);<a name="line.5746"></a>
<span class="sourceLineNo">5747</span>        this.rangeGridlineStroke = SerialUtilities.readStroke(stream);<a name="line.5747"></a>
<span class="sourceLineNo">5748</span>        this.rangeGridlinePaint = SerialUtilities.readPaint(stream);<a name="line.5748"></a>
<span class="sourceLineNo">5749</span>        this.domainMinorGridlineStroke = SerialUtilities.readStroke(stream);<a name="line.5749"></a>
<span class="sourceLineNo">5750</span>        this.domainMinorGridlinePaint = SerialUtilities.readPaint(stream);<a name="line.5750"></a>
<span class="sourceLineNo">5751</span>        this.rangeMinorGridlineStroke = SerialUtilities.readStroke(stream);<a name="line.5751"></a>
<span class="sourceLineNo">5752</span>        this.rangeMinorGridlinePaint = SerialUtilities.readPaint(stream);<a name="line.5752"></a>
<span class="sourceLineNo">5753</span>        this.rangeZeroBaselineStroke = SerialUtilities.readStroke(stream);<a name="line.5753"></a>
<span class="sourceLineNo">5754</span>        this.rangeZeroBaselinePaint = SerialUtilities.readPaint(stream);<a name="line.5754"></a>
<span class="sourceLineNo">5755</span>        this.domainCrosshairStroke = SerialUtilities.readStroke(stream);<a name="line.5755"></a>
<span class="sourceLineNo">5756</span>        this.domainCrosshairPaint = SerialUtilities.readPaint(stream);<a name="line.5756"></a>
<span class="sourceLineNo">5757</span>        this.rangeCrosshairStroke = SerialUtilities.readStroke(stream);<a name="line.5757"></a>
<span class="sourceLineNo">5758</span>        this.rangeCrosshairPaint = SerialUtilities.readPaint(stream);<a name="line.5758"></a>
<span class="sourceLineNo">5759</span>        this.domainTickBandPaint = SerialUtilities.readPaint(stream);<a name="line.5759"></a>
<span class="sourceLineNo">5760</span>        this.rangeTickBandPaint = SerialUtilities.readPaint(stream);<a name="line.5760"></a>
<span class="sourceLineNo">5761</span>        this.quadrantOrigin = SerialUtilities.readPoint2D(stream);<a name="line.5761"></a>
<span class="sourceLineNo">5762</span>        this.quadrantPaint = new Paint[4];<a name="line.5762"></a>
<span class="sourceLineNo">5763</span>        for (int i = 0; i &lt; 4; i++) {<a name="line.5763"></a>
<span class="sourceLineNo">5764</span>            this.quadrantPaint[i] = SerialUtilities.readPaint(stream);<a name="line.5764"></a>
<span class="sourceLineNo">5765</span>        }<a name="line.5765"></a>
<span class="sourceLineNo">5766</span><a name="line.5766"></a>
<span class="sourceLineNo">5767</span>        this.domainZeroBaselineStroke = SerialUtilities.readStroke(stream);<a name="line.5767"></a>
<span class="sourceLineNo">5768</span>        this.domainZeroBaselinePaint = SerialUtilities.readPaint(stream);<a name="line.5768"></a>
<span class="sourceLineNo">5769</span><a name="line.5769"></a>
<span class="sourceLineNo">5770</span>        // register the plot as a listener with its axes, datasets, and<a name="line.5770"></a>
<span class="sourceLineNo">5771</span>        // renderers...<a name="line.5771"></a>
<span class="sourceLineNo">5772</span>        int domainAxisCount = this.domainAxes.size();<a name="line.5772"></a>
<span class="sourceLineNo">5773</span>        for (int i = 0; i &lt; domainAxisCount; i++) {<a name="line.5773"></a>
<span class="sourceLineNo">5774</span>            Axis axis = (Axis) this.domainAxes.get(i);<a name="line.5774"></a>
<span class="sourceLineNo">5775</span>            if (axis != null) {<a name="line.5775"></a>
<span class="sourceLineNo">5776</span>                axis.setPlot(this);<a name="line.5776"></a>
<span class="sourceLineNo">5777</span>                axis.addChangeListener(this);<a name="line.5777"></a>
<span class="sourceLineNo">5778</span>            }<a name="line.5778"></a>
<span class="sourceLineNo">5779</span>        }<a name="line.5779"></a>
<span class="sourceLineNo">5780</span>        int rangeAxisCount = this.rangeAxes.size();<a name="line.5780"></a>
<span class="sourceLineNo">5781</span>        for (int i = 0; i &lt; rangeAxisCount; i++) {<a name="line.5781"></a>
<span class="sourceLineNo">5782</span>            Axis axis = (Axis) this.rangeAxes.get(i);<a name="line.5782"></a>
<span class="sourceLineNo">5783</span>            if (axis != null) {<a name="line.5783"></a>
<span class="sourceLineNo">5784</span>                axis.setPlot(this);<a name="line.5784"></a>
<span class="sourceLineNo">5785</span>                axis.addChangeListener(this);<a name="line.5785"></a>
<span class="sourceLineNo">5786</span>            }<a name="line.5786"></a>
<span class="sourceLineNo">5787</span>        }<a name="line.5787"></a>
<span class="sourceLineNo">5788</span>        int datasetCount = this.datasets.size();<a name="line.5788"></a>
<span class="sourceLineNo">5789</span>        for (int i = 0; i &lt; datasetCount; i++) {<a name="line.5789"></a>
<span class="sourceLineNo">5790</span>            Dataset dataset = (Dataset) this.datasets.get(i);<a name="line.5790"></a>
<span class="sourceLineNo">5791</span>            if (dataset != null) {<a name="line.5791"></a>
<span class="sourceLineNo">5792</span>                dataset.addChangeListener(this);<a name="line.5792"></a>
<span class="sourceLineNo">5793</span>            }<a name="line.5793"></a>
<span class="sourceLineNo">5794</span>        }<a name="line.5794"></a>
<span class="sourceLineNo">5795</span>        int rendererCount = this.renderers.size();<a name="line.5795"></a>
<span class="sourceLineNo">5796</span>        for (int i = 0; i &lt; rendererCount; i++) {<a name="line.5796"></a>
<span class="sourceLineNo">5797</span>            XYItemRenderer renderer = (XYItemRenderer) this.renderers.get(i);<a name="line.5797"></a>
<span class="sourceLineNo">5798</span>            if (renderer != null) {<a name="line.5798"></a>
<span class="sourceLineNo">5799</span>                renderer.addChangeListener(this);<a name="line.5799"></a>
<span class="sourceLineNo">5800</span>            }<a name="line.5800"></a>
<span class="sourceLineNo">5801</span>        }<a name="line.5801"></a>
<span class="sourceLineNo">5802</span><a name="line.5802"></a>
<span class="sourceLineNo">5803</span>    }<a name="line.5803"></a>
<span class="sourceLineNo">5804</span><a name="line.5804"></a>
<span class="sourceLineNo">5805</span>}<a name="line.5805"></a>




























































</pre>
</div>
</body>
</html>
